Browse Source

Logic can be in separated files

Vova Tkach 6 years ago
parent
commit
aafdccaced
2 changed files with 10 additions and 2 deletions
  1. 6 2
      loop.sh
  2. 4 0
      scripts/example.sh

+ 6 - 2
loop.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-# Main daemon body
-echo "Loop. Every one second. Do something here..."
+if [ -d "$SETT_DAEMON_PATH/scripts" ]; then
+	for user_script in $SETT_DAEMON_PATH/scripts/*.sh
+	do
+		. $user_script
+	done
+fi

+ 4 - 0
scripts/example.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# Example
+echo "Loop. Every one second. Do something here..."