🏡 index : github.com/captn3m0/tld-a-record.git

author Nemo <me@captnemo.in> 2020-04-27 11:18:07.0 +05:30:00
committer Nemo <me@captnemo.in> 2020-05-02 17:47:16.0 +05:30:00
commit
70e2a96dcec732b28ea8c4d97b4c96f34f055a6a [patch]
tree
6bb1bafcb904e49bb327242d84c646b5b6e4df97
parent
f2ac77c5e32f54e81c98a45fc1b4fd891980b8a0
download
70e2a96dcec732b28ea8c4d97b4c96f34f055a6a.tar.gz

Try to maintain history



Diff

 ci.sh   | 13 ++++++++++---
 scan.sh |  8 +++++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/ci.sh b/ci.sh
index 6a2d493..b155c69 100755
--- a/ci.sh
+++ a/ci.sh
@@ -1,21 +1,22 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

BRANCH="gh-pages"
# Run the scan

cd website
bundle install
bundle show
bundle exec jekyll build --verbose --destination _site

git clone "$GIT_REMOTE" --branch "$BRANCH" /tmp/remote_site

if ([ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ]); then
  cd _site
  git init
  git remote add origin "$GIT_REMOTE"
  cp -r _site/* /tmp/remote_site
  cd /tmp/remote_site
  git add .
  git commit -m "Deploy to GitHub Pages"
  git push --force --quiet origin master:gh-pages > /dev/null 2>&1
  git commit -m "Update: `date`"
  git push --force --quiet origin > /dev/null 2>&1
  echo 'Build successful, deployed to gh-pages.'
else
  echo "Build successful, but not deploying!"
diff --git a/scan.sh b/scan.sh
index 14deaa7..2591287 100755
--- a/scan.sh
+++ a/scan.sh
@@ -1,14 +1,14 @@
#!/bin/bash

# This script runs a scan for all available TLDs, and notes
# down the TLDs that resolve to `website/template.md`
# 
#
# It also puts some information about the IP Adress from where
# the scan was run (might be relevant for DNS lookups) into
# `website/_data/ip.json`. Structure is at ipapi.co

for domain in $(grep -v '^#' tlds.txt); do 
    RESULT=$(dig +time=1 +tries=1 +short "$domain" | head -c -1 | tr '\n' '@' | sed 's/@/`,`/g' | grep -v "connection timed out")
for domain in $(grep -v '^#' tlds.txt); do
    RESULT=$(dig +time=1 +tries=1 +short "$domain." | head -c -1 | tr '\n' '@' | sed 's/@/`,`/g' | grep -v "connection timed out")
    if [ ! -z "$RESULT" ]; then
        echo $domain
        DOMAIN_REAL="$domain"
@@ -23,4 +23,4 @@
curl 'https://ipapi.co/yaml/' > website/_data/ip.json

echo >> template.md
echo "This scan was last run on $(date)" >> template.md
echo "This scan was last run on $(date)" >> template.md