ArtyomV2X 1 ヶ月 前
コミット
5554a3cdd8
3 ファイル変更14 行追加14 行削除
  1. 5 5
      README.md
  2. 7 7
      install.sh
  3. 2 2
      update.sh

+ 5 - 5
README.md

@@ -40,7 +40,7 @@ entirely from a built-in web UI.
 2. Run the one-liner:
 
 ```sh
-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
 ```
 
 The installer will:
@@ -57,11 +57,11 @@ The installer will:
 Non-interactive install:
 
 ```sh
-DISCORD_BOT_TOKEN=xxxxx wget -qO- https://gogs.av2x.dev/av2x/Dis2Hook/raw/main/install.sh | ash
+DISCORD_BOT_TOKEN=xxxxx wget -qO- https://gogs.av2x.dev/av2x/Dis2Hook/raw/master/install.sh | ash
 ```
 
-Optional environment overrides: `D2H_BRANCH` (defaults to `main`, auto-falls
-back to `master`), `D2H_DIR` (default `/opt/dis2hook`), `D2H_PORT` (default `8823`).
+Optional environment overrides: `D2H_BRANCH` (defaults to `master`, auto-falls
+back to `main`), `D2H_DIR` (default `/opt/dis2hook`), `D2H_PORT` (default `8823`).
 
 ## First-time setup
 
@@ -154,4 +154,4 @@ built in.
 ```sh
 rc-service dis2hook stop; rc-update del dis2hook default
 rm -rf /opt/dis2hook /etc/init.d/dis2hook /var/log/dis2hook.log
-```
+```

+ 7 - 7
install.sh

@@ -4,10 +4,10 @@
 # Proxmox host itself.
 #
 # 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:
-#   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_PORT=8823              web UI / webhook listen port
 #   DISCORD_BOT_TOKEN=...      skip the interactive token prompt
@@ -15,7 +15,7 @@
 set -eu
 
 REPO="${D2H_REPO:-https://gogs.av2x.dev/av2x/Dis2Hook}"
-BRANCH="${D2H_BRANCH:-main}"
+BRANCH="${D2H_BRANCH:-master}"
 APP_DIR="${D2H_DIR:-/opt/dis2hook}"
 PORT="${D2H_PORT:-8823}"
 SERVICE="dis2hook"
@@ -42,9 +42,9 @@ say "Checking repository branch '$BRANCH'…"
 TMP="$(mktemp -d)"
 trap 'rm -rf "$TMP"' EXIT
 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
         fail "Could not download app.py from $REPO (branch $BRANCH). Check network/DNS inside the container."
     fi
@@ -130,4 +130,4 @@ say "  App dir    : $APP_DIR"
 say "  Logs       : tail -f /var/log/dis2hook.log"
 say "  Update     : $APP_DIR/update.sh"
 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."

+ 2 - 2
update.sh

@@ -13,7 +13,7 @@ set -eu
 REPO="${D2H_REPO:-https://gogs.av2x.dev/av2x/Dis2Hook}"
 APP_DIR="$(cd "$(dirname "$0")" && pwd)"
 SERVICE="dis2hook"
-BRANCH="${D2H_BRANCH:-$(cat "$APP_DIR/.branch" 2>/dev/null || echo main)}"
+BRANCH="${D2H_BRANCH:-$(cat "$APP_DIR/.branch" 2>/dev/null || echo master)}"
 
 say()  { printf '\033[1;33m[dis2hook]\033[0m %s\n' "$*"; }
 fail() { printf '\033[1;31m[dis2hook] ERROR:\033[0m %s\n' "$*" >&2; exit 1; }
@@ -53,4 +53,4 @@ if rc-service "$SERVICE" restart >/dev/null 2>&1; then
     say "Service restarted — Dis2Hook v$NEW_VER is live."
 else
     say "Could not restart via OpenRC. Start manually: rc-service $SERVICE start"
-fi
+fi