diff --git a/roles/shell/files/gopher-run b/roles/shell/files/gopher-run new file mode 100644 index 0000000..8b317fa --- /dev/null +++ b/roles/shell/files/gopher-run @@ -0,0 +1,14 @@ +#!/bin/bash +export RUNNING="/dev/shm/gopher_is_running" + +if [ -f $RUNNING ]; then + echo "Gopher is currently running." + exit 1 +else + touch $RUNNING + cd /var/gopher + /usr/bin/git pull + touch /dev/shm/ansible-hook-last-run + rm $RUNNING + exit 0 +fi diff --git a/roles/shell/files/gopher-run.path b/roles/shell/files/gopher-run.path new file mode 100644 index 0000000..3199852 --- /dev/null +++ b/roles/shell/files/gopher-run.path @@ -0,0 +1,6 @@ +[Unit] +Description=gopher-run path +[Path] +PathModified=/dev/shm/gopher-ansible +[Install] +WantedBy=multi-user.target diff --git a/roles/shell/files/gopher-run.service b/roles/shell/files/gopher-run.service new file mode 100644 index 0000000..18099c5 --- /dev/null +++ b/roles/shell/files/gopher-run.service @@ -0,0 +1,4 @@ +[Unit] +Description=gopher-run +[Service] +ExecStart=/usr/local/bin/gopher-run