|
@@ -4,10 +4,10 @@
|
|
|
# Proxmox host itself.
|
|
# Proxmox host itself.
|
|
|
#
|
|
#
|
|
|
# One-liner:
|
|
# One-liner:
|
|
|
-# wget -qO- https://gogs.av2x.dev/av2x/Dis2Hook/raw/main/install.sh | ash
|
|
|
|
|
|
|
+# wget -qO- https://gogs.av2x.dev/av2x/Dis2Hook/raw/master/install.sh | ash
|
|
|
#
|
|
#
|
|
|
# Options via environment:
|
|
# Options via environment:
|
|
|
-# D2H_BRANCH=main branch to pull from (auto-falls back to master)
|
|
|
|
|
|
|
+# D2H_BRANCH=master branch to pull from (auto-falls back to main)
|
|
|
# D2H_DIR=/opt/dis2hook install directory
|
|
# D2H_DIR=/opt/dis2hook install directory
|
|
|
# D2H_PORT=8823 web UI / webhook listen port
|
|
# D2H_PORT=8823 web UI / webhook listen port
|
|
|
# DISCORD_BOT_TOKEN=... skip the interactive token prompt
|
|
# DISCORD_BOT_TOKEN=... skip the interactive token prompt
|
|
@@ -15,7 +15,7 @@
|
|
|
set -eu
|
|
set -eu
|
|
|
|
|
|
|
|
REPO="${D2H_REPO:-https://gogs.av2x.dev/av2x/Dis2Hook}"
|
|
REPO="${D2H_REPO:-https://gogs.av2x.dev/av2x/Dis2Hook}"
|
|
|
-BRANCH="${D2H_BRANCH:-main}"
|
|
|
|
|
|
|
+BRANCH="${D2H_BRANCH:-master}"
|
|
|
APP_DIR="${D2H_DIR:-/opt/dis2hook}"
|
|
APP_DIR="${D2H_DIR:-/opt/dis2hook}"
|
|
|
PORT="${D2H_PORT:-8823}"
|
|
PORT="${D2H_PORT:-8823}"
|
|
|
SERVICE="dis2hook"
|
|
SERVICE="dis2hook"
|
|
@@ -42,9 +42,9 @@ say "Checking repository branch '$BRANCH'…"
|
|
|
TMP="$(mktemp -d)"
|
|
TMP="$(mktemp -d)"
|
|
|
trap 'rm -rf "$TMP"' EXIT
|
|
trap 'rm -rf "$TMP"' EXIT
|
|
|
if ! fetch app.py "$TMP/app.py"; then
|
|
if ! fetch app.py "$TMP/app.py"; then
|
|
|
- if [ "$BRANCH" = "main" ] && wget -q -O "$TMP/app.py" "$REPO/raw/master/app.py" && [ -s "$TMP/app.py" ]; then
|
|
|
|
|
- BRANCH="master"
|
|
|
|
|
- say "Branch 'main' not found, using 'master'."
|
|
|
|
|
|
|
+ if [ "$BRANCH" = "master" ] && wget -q -O "$TMP/app.py" "$REPO/raw/main/app.py" && [ -s "$TMP/app.py" ]; then
|
|
|
|
|
+ BRANCH="main"
|
|
|
|
|
+ say "Branch 'master' not found, using 'main'."
|
|
|
else
|
|
else
|
|
|
fail "Could not download app.py from $REPO (branch $BRANCH). Check network/DNS inside the container."
|
|
fail "Could not download app.py from $REPO (branch $BRANCH). Check network/DNS inside the container."
|
|
|
fi
|
|
fi
|
|
@@ -130,4 +130,4 @@ say " App dir : $APP_DIR"
|
|
|
say " Logs : tail -f /var/log/dis2hook.log"
|
|
say " Logs : tail -f /var/log/dis2hook.log"
|
|
|
say " Update : $APP_DIR/update.sh"
|
|
say " Update : $APP_DIR/update.sh"
|
|
|
say "──────────────────────────────────────────────────────"
|
|
say "──────────────────────────────────────────────────────"
|
|
|
-say "Keep the admin key safe — it is stored only in token.json."
|
|
|
|
|
|
|
+say "Keep the admin key safe — it is stored only in token.json."
|