summaryrefslogtreecommitdiff
path: root/lume-watcher
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2024-08-23 03:04:30 +0900
committerhaturatu <taro@eyes4you.org>2024-08-23 03:04:30 +0900
commit357feae0fc1f3298ec9d0f62b16fb2aaa602e00d (patch)
tree7efd3134bfd458827011c432cbd34e4c04765841 /lume-watcher
parente7b81eaab8f9928e24977728979ba4ed5e68f4db (diff)
wip
Diffstat (limited to 'lume-watcher')
-rw-r--r--lume-watcher6
1 files changed, 5 insertions, 1 deletions
diff --git a/lume-watcher b/lume-watcher
index e1d9b8d..3d299c0 100644
--- a/lume-watcher
+++ b/lume-watcher
@@ -52,9 +52,12 @@ monitor_directory() {
if [ $((now - last_run_time)) -ge $COOLDOWN_TIME ]; then
echo "$(date): Executing command" >> "$LOG_FILE"
+
+ sleep 10
cd /var/www/html/soulmining || exit
$COMMAND >> "$LOG_FILE" 2>&1
cd ~ || exit
+
set_last_run_time
else
echo "$(date): Command not executed due to cooldown" >> "$LOG_FILE"
@@ -82,6 +85,7 @@ stop() {
status() {
if [ -f "$PID_FILE" ]; then
+ cat "$PID_FILE"
echo "Service is running."
else
echo "Service is stopped."
@@ -103,7 +107,7 @@ case "$1" in
start
;;
*)
- echo "Usage: /etc/init.d/lume-watcher {start|stop|status|restart}"
+ echo "Usage: lume-watcher {start|stop|status|restart}"
exit 1
;;
esac