replace last run variable

This commit is contained in:
Blade of Darkness 2020-12-05 18:09:03 +01:00
parent 5c53230537
commit c21c6a7f55

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
export RUNNING="/dev/shm/ansible_is_running" export RUNNING="/dev/shm/ansible_is_running"
export HOOK="/dev/shm/ansible-hook-last-run"
ansible_is_running() ansible_is_running()
{ {
@ -10,11 +11,9 @@ ansible_is_running()
if [ -f $RUNNING ]; then if [ -f $RUNNING ]; then
echo "Ansible is currently running." echo "Ansible is currently running."
exit 1
else else
touch $RUNNING touch $RUNNING
ansible_is_running ansible_is_running
touch /dev/shm/ansible-hook-last-run touch $HOOK
rm $RUNNING rm $RUNNING
exit 0
fi fi