From fb38b8ccb43fa3f88eeecced200ae537d8760b91 Mon Sep 17 00:00:00 2001 From: short <> Date: Thu, 18 Apr 2002 15:21:57 +0000 Subject: [PATCH] +optional argument $1 to override detected IP address /home/short/secure/ndc-reload-short += argument "kratochvil.vellum.cz" --- bin/kratochvil.vellum.cz-update | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 1.8.3.1