summaryrefslogtreecommitdiff
path: root/roles/flatbot/files/run-flatbot
diff options
context:
space:
mode:
Diffstat (limited to 'roles/flatbot/files/run-flatbot')
-rwxr-xr-xroles/flatbot/files/run-flatbot27
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/flatbot/files/run-flatbot b/roles/flatbot/files/run-flatbot
new file mode 100755
index 0000000..1d8869d
--- /dev/null
+++ b/roles/flatbot/files/run-flatbot
@@ -0,0 +1,27 @@
+#! /usr/bin/env bash
+
+# Simple wrapper script to read URLs from configuration file.
+
+if [ "$#" -ne 2 ]; then
+ echo "Illegal number of parameters" 1>&2
+ exit 1
+fi
+
+state=$1
+urlsfile=$2
+
+urls=""
+
+while IFS= read -r line;
+do
+ case "$line" in
+ ""|\#*)
+ continue
+ ;;
+ *)
+ urls="${urls} ${line}"
+ ;;
+ esac
+done < $urlsfile
+
+exec /usr/bin/flatbot -state $state -once ${urls}