There are several instances of unexpanded variables in here: sleep $(( net_hickup_time - SECONDS )) reboot_timeout=$(( reboot_timeout + SECONDS )) echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$" if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \