diff --git a/build_ansible.sh b/build_ansible.sh index e12e66b..b2e17d4 100644 --- a/build_ansible.sh +++ b/build_ansible.sh @@ -18,7 +18,7 @@ if [ -f /ansible/current ]; then regrab=true else c_time=`date +%s` - if [ `expr $c_time - $l_time` -gt 120 ]; then + if [[ `expr $c_time - $l_time` -gt 120 ]]; then regrab=true fi fi @@ -32,7 +32,7 @@ if $regrab;then # verify that download was sucessful count=`grep -P "(#!/bin/bash)|(end of build_ansible.sh)" /tmp/build_ansible.sh | wc -l` - if [ "$count" != "2" ];then + if [ "$count" != "3" ];then echo "failed to grab latest build_ansible.sh file, exiting" exit fi @@ -44,7 +44,7 @@ if $regrab;then # verify the parent script is not build_ansible.sh (to prevent the possibility of recurring until the system crashes in the case of an issue) me=$(basename "$0") parent=$(ps -o args= $PPID) - if [[ "$PARENT" != *"$ME"* ]];then + if [[ "$parent" != *"$me"* ]];then /bin/bash /ansible/build_ansible.sh fi exit