summaryrefslogtreecommitdiff
path: root/forgebot_proper.sh
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-17 12:44:39 +0200
committerLinnea Gräf <nea@nea.moe>2024-10-17 12:44:39 +0200
commitb7bf0368732edbc9858035432ba86b6b9b23545c (patch)
tree31e6cff7eb72ebe46dd6a7bdabd4bf05d8bd266d /forgebot_proper.sh
parent6b85dda202b6305b38100a474037e5f05ed7b48d (diff)
downloadforgebot-b7bf0368732edbc9858035432ba86b6b9b23545c.tar.gz
forgebot-b7bf0368732edbc9858035432ba86b6b9b23545c.tar.bz2
forgebot-b7bf0368732edbc9858035432ba86b6b9b23545c.zip
Add docker file
Diffstat (limited to 'forgebot_proper.sh')
-rwxr-xr-xforgebot_proper.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/forgebot_proper.sh b/forgebot_proper.sh
index e1a8971..947be04 100755
--- a/forgebot_proper.sh
+++ b/forgebot_proper.sh
@@ -1,4 +1,24 @@
#!/bin/bash
+
+program_exists() {
+ which "$1" >/dev/null
+ return $?
+}
+require_program() {
+ for prog in "$@"; do
+ if ! program_exists "$prog"; then
+ echo "Missing program: $prog"
+ exit 1
+ fi
+ done
+}
+require_program curl jq websocat printf grep find sed mkdir touch rm mv mkfifo basename tty
+if ! [[ "$(grep --version)" = *GNU* ]]; then
+ echo Using non-GNU grep. This can cause issues since we use some non standard grep options.
+ exit 1
+fi
+
+
[[ -f "$(dirname -- "$0")"/env.sh ]] && source "$(dirname -- "$0")"/env.sh
if [[ x"$ATROCITY_TOKEN" == x ]]; then
echo "Please set ATROCITY_TOKEN to your discord token"