summaryrefslogtreecommitdiff
path: root/roles/flatbot/files/run-flatbot
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2026-02-07 17:47:16 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2026-02-07 21:19:50 +0000
commitdfff28513622f659430ef064322cfa701513feb0 (patch)
tree2c9457db3635c3ee1f748ba5d21c5ba8e8538109 /roles/flatbot/files/run-flatbot
parentf34ef9c98c3b24d170d178f381aaf8ed50b1c729 (diff)
downloadinfra-dfff28513622f659430ef064322cfa701513feb0.tar.gz
infra-dfff28513622f659430ef064322cfa701513feb0.tar.bz2
infra-dfff28513622f659430ef064322cfa701513feb0.zip
Add run-flatbot wrapper script
Goal is to keep all URLs in one place (file), because I forget to modify multiple files, when make changes.
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}