From cb610066db280982b9dfedeac2b093cbd6bb00be Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Fri, 22 Mar 2019 21:53:49 +0000 Subject: [PATCH] Helps to add all the files --- roles/shell/files/gopher-run | 14 ++++++++++++++ roles/shell/files/gopher-run.path | 6 ++++++ roles/shell/files/gopher-run.service | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 roles/shell/files/gopher-run create mode 100644 roles/shell/files/gopher-run.path create mode 100644 roles/shell/files/gopher-run.service diff --git a/roles/shell/files/gopher-run b/roles/shell/files/gopher-run new file mode 100644 index 00000000..8b317fa1 --- /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 00000000..31998523 --- /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 00000000..18099c51 --- /dev/null +++ b/roles/shell/files/gopher-run.service @@ -0,0 +1,4 @@ +[Unit] +Description=gopher-run +[Service] +ExecStart=/usr/local/bin/gopher-run