From: short <> Date: Thu, 18 Apr 2002 15:21:57 +0000 (+0000) Subject: +optional argument $1 to override detected IP address X-Git-Tag: bp_liverpm~155 X-Git-Url: http://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=fb38b8ccb43fa3f88eeecced200ae537d8760b91 +optional argument $1 to override detected IP address /home/short/secure/ndc-reload-short += argument "kratochvil.vellum.cz" --- diff --git a/bin/kratochvil.vellum.cz-update b/bin/kratochvil.vellum.cz-update index 99b5c01..bbf3113 100755 --- a/bin/kratochvil.vellum.cz-update +++ b/bin/kratochvil.vellum.cz-update @@ -2,6 +2,7 @@ lockfile="/home/short/bin/kratochvil.vellum.cz-update.lock" 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