# HG changeset patch # User cathugger # Date 1489116616 0 # Node ID 2f57d4d367597c9e176bb8692b27b27510f7bb78 # Parent a0de6dd1652e81afacffa59f0727a17b938973f5 add muh nameserver, some script tweaks diff -r a0de6dd1652e -r 2f57d4d36759 db/as/6370/owner --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/as/6370/owner Fri Mar 10 03:30:16 2017 +0000 @@ -0,0 +1,1 @@ +cathugger diff -r a0de6dd1652e -r 2f57d4d36759 db/dom/ano/cathugger/ns/uz56x91zhcjmtvt5r6gj8fg5rxybgqw9wvu5vpy55gp4vjhllbtwl5.ns.cathugger.ano --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/dom/ano/cathugger/ns/uz56x91zhcjmtvt5r6gj8fg5rxybgqw9wvu5vpy55gp4vjhllbtwl5.ns.cathugger.ano Fri Mar 10 03:30:16 2017 +0000 @@ -0,0 +1,1 @@ +1.0.0.0 diff -r a0de6dd1652e -r 2f57d4d36759 db/dom/ano/cathugger/owner --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/dom/ano/cathugger/owner Fri Mar 10 03:30:16 2017 +0000 @@ -0,0 +1,1 @@ +cathugger diff -r a0de6dd1652e -r 2f57d4d36759 db/ip/15/00/00/cidr --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/ip/15/00/00/cidr Fri Mar 10 03:30:16 2017 +0000 @@ -0,0 +1,1 @@ +21.0.0.0/24 diff -r a0de6dd1652e -r 2f57d4d36759 db/ip/15/00/00/owner --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/ip/15/00/00/owner Fri Mar 10 03:30:16 2017 +0000 @@ -0,0 +1,1 @@ +cathugger diff -r a0de6dd1652e -r 2f57d4d36759 scripts/add_ip --- a/scripts/add_ip Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/add_ip Fri Mar 10 03:30:16 2017 +0000 @@ -5,7 +5,7 @@ fi cidr="$1" -hex="$(./scripts/cidr2hex "$cidr")" +hex=$($(dirname "$0")/cidr2hex "$cidr") || exit 1 dir=db/ip/"$hex" if [ -e "$dir" ]; then echo "Refusing to clobber existing record" >&2; exit 1 diff -r a0de6dd1652e -r 2f57d4d36759 scripts/cidr2hex --- a/scripts/cidr2hex Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/cidr2hex Fri Mar 10 03:30:16 2017 +0000 @@ -4,4 +4,6 @@ echo "Usage: $0 " >&2; exit 255 fi -./scripts/ip2hex "$(./scripts/cidr2ip "$1")" +dn=$(dirname "$0") +ip=$("$dn"/cidr2ip "$1") || exit 1 +"$dn"/ip2hex "$ip" diff -r a0de6dd1652e -r 2f57d4d36759 scripts/dec2hex --- a/scripts/dec2hex Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/dec2hex Fri Mar 10 03:30:16 2017 +0000 @@ -17,6 +17,6 @@ bc -q ) | tail -c3 else - cat ./scripts/dec2hex.d/"$(cat)" + cat `dirname "$0"`/dec2hex.d/"$(cat)" fi ) diff -r a0de6dd1652e -r 2f57d4d36759 scripts/git-config --- a/scripts/git-config Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/git-config Fri Mar 10 03:30:16 2017 +0000 @@ -1,5 +1,5 @@ #!/bin/sh -[ -z $2 ] && echo 'Usage: ./scripts/git-config ' +[ -z $2 ] && echo "Usage: $0 " >&2 [ -z $2 ] && exit 1 git config user.name $1 diff -r a0de6dd1652e -r 2f57d4d36759 scripts/git-pull --- a/scripts/git-pull Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/git-pull Fri Mar 10 03:30:16 2017 +0000 @@ -1,7 +1,6 @@ -#!/bin/bash +#!/bin/sh if [ -z "$1" ]; then - echo './scripts/git-pull $PEER_NAME' + echo "Usage: $0 \$PEER_NAME" >&2 exit 1 fi -[ -e db/usr/"$1"/git ] && git pull `cat db/usr/"$1"/git` master -[ -e db/usr/"$1"/git ] || echo "./git-pull: record does not exist for $1" +[ -e db/usr/"$1"/git ] && git pull `cat db/usr/"$1"/git` master || echo "$0: record does not exist for $1" >&2 diff -r a0de6dd1652e -r 2f57d4d36759 scripts/hex2dec --- a/scripts/hex2dec Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/hex2dec Fri Mar 10 03:30:16 2017 +0000 @@ -12,6 +12,6 @@ if [ x"$USE_BC" = x1 ]; then bc -q else - cat ./scripts/hex2dec.d/"$(cat)" + cat `dirname "$0"`/hex2dec.d/"$(cat)" fi ) diff -r a0de6dd1652e -r 2f57d4d36759 scripts/ip2hex --- a/scripts/ip2hex Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/ip2hex Fri Mar 10 03:30:16 2017 +0000 @@ -5,5 +5,5 @@ fi for x in $(echo -n "$1" | tr . ' ') ; do - ./scripts/dec2hex "$x" +`dirname "$0"`/dec2hex "$x" done | tr '\n' / | head -c -1 ; echo diff -r a0de6dd1652e -r 2f57d4d36759 scripts/ns2ip --- a/scripts/ns2ip Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/ns2ip Fri Mar 10 03:30:16 2017 +0000 @@ -3,7 +3,7 @@ opt="$1" if [ "x$opt" = "x-f" ]; then shift -elif ! ./scripts/check_db_safety; then +elif ! `dirname "$0"`/check_db_safety; then exit 1 fi ns="$1" diff -r a0de6dd1652e -r 2f57d4d36759 scripts/update-git-remotes --- a/scripts/update-git-remotes Fri Mar 10 01:12:23 2017 +0000 +++ b/scripts/update-git-remotes Fri Mar 10 03:30:16 2017 +0000 @@ -4,7 +4,7 @@ # TODO: detect users' git address changes # -if ! ./scripts/check_db_safety; then +if ! `dirname "$0"`/check_db_safety; then exit 1 fi