summaryrefslogtreecommitdiff
path: root/scripts/check-params-on-reboot.d
diff options
context:
space:
mode:
authorDaniil Baturin <daniil.baturin@vyatta.com>2011-12-13 03:46:31 +0700
committerDaniil Baturin <daniil.baturin@vyatta.com>2011-12-13 03:46:31 +0700
commita468a3b2886079614311253079e003573698900d (patch)
treef8d894610bcc836da6923aceaa335269f15f24f1 /scripts/check-params-on-reboot.d
parent45f00a75efdafa2b1d3d5acd90be43c66e410c90 (diff)
downloadvyatta-conntrack-a468a3b2886079614311253079e003573698900d.tar.gz
vyatta-conntrack-a468a3b2886079614311253079e003573698900d.zip
Handle the case of missing config version on reboot properly.
Diffstat (limited to 'scripts/check-params-on-reboot.d')
-rwxr-xr-xscripts/check-params-on-reboot.d/conntrack-hash-size6
1 files changed, 6 insertions, 0 deletions
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)