Dew-OF-Aurora 2 minggu lalu
induk
melakukan
b528de2f14
1 mengubah file dengan 7 tambahan dan 14 penghapusan
  1. 7 14
      scripts/run_update_and_commit.sh

+ 7 - 14
scripts/run_update_and_commit.sh

@@ -40,28 +40,20 @@ git_auth() {
   fi
 }
 
-before=""
-if [[ -f "$DOMAIN_FILE" ]]; then
-  before="$(tr -d '\r\n' < "$DOMAIN_FILE")"
-fi
-
 /usr/bin/python3 "${APP_DIR}/scripts/domain_updater.py" --config "$CONFIG_PATH"
 
-after=""
-if [[ -f "$DOMAIN_FILE" ]]; then
-  after="$(tr -d '\r\n' < "$DOMAIN_FILE")"
+if [[ ! -f "$DOMAIN_FILE" ]]; then
+  echo "[vmess-domain-rotator] runtime/current_domain.txt missing after updater run, skip git commit"
+  exit 0
 fi
 
+after="$(tr -d '\r\n' < "$DOMAIN_FILE")"
+
 if [[ -z "$after" ]]; then
   echo "[vmess-domain-rotator] empty selected domain, skip git commit"
   exit 0
 fi
 
-if [[ "$before" == "$after" ]]; then
-  echo "[vmess-domain-rotator] domain unchanged (${after}), skip git commit"
-  exit 0
-fi
-
 if ! command -v git >/dev/null 2>&1; then
   echo "[vmess-domain-rotator] git not found, skip git commit"
   exit 0
@@ -178,4 +170,5 @@ else
   fi
 fi
 
-echo "[vmess-domain-rotator] committed domain change on ${runtime_branch}: ${before} -> ${after}"
+echo "[vmess-domain-rotator] committed runtime changes on ${runtime_branch}: selected domain ${after}"
+