@@ -6,8 +6,6 @@ trap 'echo -e "\n❌ An error occurred. Aborting."; exit 1' ERR
66# ========== Variables ==========
77HYSTERIA_INSTALL_DIR=" /etc/hysteria"
88HYSTERIA_VENV_DIR=" $HYSTERIA_INSTALL_DIR /hysteria2_venv"
9- GEOSITE_URL=" https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geosite.dat"
10- GEOIP_URL=" https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geoip.dat"
119MIGRATE_SCRIPT_PATH=" $HYSTERIA_INSTALL_DIR /core/scripts/db/migrate_users.py"
1210
1311# ========== Color Setup ==========
@@ -225,7 +223,7 @@ fix_caddy_repo
225223install_mongodb
226224
227225# ========== Migrate NormalSub Path (if necessary) ==========
228- migrate_normalsub_path
226+ # migrate_normalsub_path
229227
230228# ========== Backup Files ==========
231229cd /root
@@ -238,42 +236,38 @@ FILES=(
238236 " $HYSTERIA_INSTALL_DIR /.configs.env"
239237 " $HYSTERIA_INSTALL_DIR /nodes.json"
240238 " $HYSTERIA_INSTALL_DIR /extra.json"
239+ " $HYSTERIA_INSTALL_DIR /geosite.dat"
240+ " $HYSTERIA_INSTALL_DIR /geoip.dat"
241241 " $HYSTERIA_INSTALL_DIR /core/scripts/telegrambot/.env"
242242 " $HYSTERIA_INSTALL_DIR /core/scripts/normalsub/.env"
243243 " $HYSTERIA_INSTALL_DIR /core/scripts/normalsub/Caddyfile.normalsub"
244244 " $HYSTERIA_INSTALL_DIR /core/scripts/webpanel/.env"
245245 " $HYSTERIA_INSTALL_DIR /core/scripts/webpanel/Caddyfile"
246246)
247247
248- info " Backing up configuration files to: $TEMP_DIR "
248+ info " Backing up configuration and data files to: $TEMP_DIR "
249249for FILE in " ${FILES[@]} " ; do
250250 if [[ -f " $FILE " ]]; then
251251 mkdir -p " $TEMP_DIR /$( dirname " $FILE " ) "
252252 cp -p " $FILE " " $TEMP_DIR /$FILE "
253253 success " Backed up: $FILE "
254254 else
255- warn " File not found: $FILE "
255+ warn " File not found, skipping backup : $FILE "
256256 fi
257257done
258258
259259# ========== Download and Replace Installation ==========
260260download_and_extract_latest_release
261261
262- # ========== Download Geo Data ==========
263- info " Downloading geosite.dat and geoip.dat..."
264- wget -q -O " $HYSTERIA_INSTALL_DIR /geosite.dat" " $GEOSITE_URL "
265- wget -q -O " $HYSTERIA_INSTALL_DIR /geoip.dat" " $GEOIP_URL "
266- success " Geo data downloaded."
267-
268262# ========== Restore Backup ==========
269- info " Restoring configuration files..."
263+ info " Restoring configuration and data files..."
270264for FILE in " ${FILES[@]} " ; do
271265 BACKUP=" $TEMP_DIR /$FILE "
272266 if [[ -f " $BACKUP " ]]; then
273267 cp -p " $BACKUP " " $FILE "
274268 success " Restored: $FILE "
275269 else
276- warn " Missing backup file: $BACKUP "
270+ warn " Missing backup file, skipping restore : $BACKUP "
277271 fi
278272done
279273
0 commit comments