From 861aa7fa0a2aff4a3d5a20279b9c5d34dc07e78f Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 31 Oct 2023 13:26:39 +0100 Subject: [PATCH] do not match own process lol --- .local/bin/moodle-dl-update | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .local/bin/moodle-dl-update diff --git a/.local/bin/moodle-dl-update b/.local/bin/moodle-dl-update new file mode 100755 index 0000000..ff3a8eb --- /dev/null +++ b/.local/bin/moodle-dl-update @@ -0,0 +1,12 @@ +#!/bin/sh +MOODLE_DIR="/home/alex/eth/.moodle" +cd "$MOODLE_DIR" +echo "pgrepping" +pgrep -x moodle-dl +if ! pgrep -x moodle-dl; then + echo "nothing" + [ -f running.lock ] && rm running.lock + moodle-dl >/dev/null 2>&1 +else + echo "something" +fi