X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fkratochvil.vellum.cz-update;h=bbf31130142aebacb648666e4c80aeab72dfd9bc;hp=c32a5b4f64846f223db84c9a0cfa703c6c298d3a;hb=271bd12bf3ce2bbf0e03fa5fe2bec93840d2c247;hpb=723b98f5494c23fe7bcf021ef4024887c24e4122 diff --git a/bin/kratochvil.vellum.cz-update b/bin/kratochvil.vellum.cz-update index c32a5b4..bbf3113 100755 --- a/bin/kratochvil.vellum.cz-update +++ b/bin/kratochvil.vellum.cz-update @@ -1,7 +1,8 @@ #! /bin/sh lockfile="/home/short/bin/kratochvil.vellum.cz-update.lock" -kratochvil_IP="`echo "$SSH_CLIENT"|cut -d ' ' -f 1`" +kratochvil_IP="`echo "${SSH_CLIENT:-$SSH2_CLIENT}"|cut -d ' ' -f 1`" +kratochvil_IP="${1:-$kratochvil_IP}" kratochvil_IP_back="`echo "$kratochvil_IP"|sed 's/\./\\\\./g'`" named_dir="/etc/named" cf_file="$named_dir/cf/kratochvil.vellum.cz" @@ -20,6 +21,6 @@ if grep -q '^ `'"$kratochvil_IP_back'"'$' "$cf_file";then echo "$0: Updating new IP $kratochvil_IP..." echo -e '%s#\(^ `\)[0-9.]*\('"'"'\)$#\\1'"$kratochvil_IP"'\\2#\nw'|ed -s "$cf_file" make -C "$named_dir" --assume-new="ver/.version" -/home/short/secure/ndc-reload-short +/home/short/secure/ndc-reload-short kratochvil.vellum.cz echo "$0: Update done." exit 0