1234567891011121314151617181920 |
- if [ ! -f /var/cache/salt/state_apply ] ; then echo "Statefile does not exist" ; exit 3 ; fi
- if [ $(($(date +%s) - $(date -r /var/cache/salt/state_apply +%s))) -gt 25200 ] ; then echo "Statefile too old" ; exit 3 ; fi
- CHANGES_IDS=$(grep "ID:" /var/cache/salt/state_apply | grep -v "ID: .*-repo$")
- if [ -n "$CHANGES_IDS" ] ; then
- echo "IDs with changes:"
- echo "$CHANGES_IDS"
- exit 1
- fi
- echo "Nothing to do"
- exit 0
|