From: Tom Hughes Date: Wed, 5 Jun 2013 20:18:49 +0000 (+0100) Subject: Allow the path to the tile replication state to be set X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/d2080b805cf3f4af751ad228a4d4eb31c6982d50 Allow the path to the tile replication state to be set --- diff --git a/cookbooks/munin/files/default/plugins/replication_delay b/cookbooks/munin/files/default/plugins/replication_delay index e88ae97a1..2a787d1b9 100755 --- a/cookbooks/munin/files/default/plugins/replication_delay +++ b/cookbooks/munin/files/default/plugins/replication_delay @@ -19,10 +19,11 @@ if [ "$1" = "config" ]; then echo 'age.cdef age,60,/' exit 0 fi - -tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q /home/jburgess/replicate/state.txt` + +state=${state:-/home/jburgess/replicate/state.txt} +tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q ${state}` tstampsec=`date --date=$tstamp +%s` nowsec=`date +%s` -echo "age.value " `expr $nowsec - $tstampsec` \ No newline at end of file +echo "age.value " `expr $nowsec - $tstampsec`