From a468a3b2886079614311253079e003573698900d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 13 Dec 2011 03:46:31 +0700 Subject: Handle the case of missing config version on reboot properly. --- scripts/check-params-on-reboot.d/conntrack-hash-size | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/check-params-on-reboot.d/conntrack-hash-size b/scripts/check-params-on-reboot.d/conntrack-hash-size index a2063cb..4849bda 100755 --- a/scripts/check-params-on-reboot.d/conntrack-hash-size +++ b/scripts/check-params-on-reboot.d/conntrack-hash-size @@ -7,6 +7,12 @@ BOOTFILE=$1 # Obtain firewall config version version=`tail -n 2 $BOOTFILE | sed -n 's/.*\(firewall\@[0-9]\).*/\1/; h; x;p;q' | awk -F '@' '{print $2}'` + +if [ -z $version ]; then + echo "Warning: could not determine firewall config version. Conntrack hash size will not be updated." + exit 1 +fi + if [ $version -ge 5 ]; then # The config is from oxnard or higher cthash_cfg=$(cli-shell-api cfReturnValue $BOOTFILE system conntrack hash-size) -- cgit v1.2.3