forked from slobys/openclash-auto-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auto-download.sh
More file actions
executable file
·29 lines (23 loc) · 911 Bytes
/
Copy pathtest-auto-download.sh
File metadata and controls
executable file
·29 lines (23 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -eu
# Legacy compatibility entrypoint.
# The old test downloader was opkg-only and duplicated PassWall download logic.
# Keep this filename working by delegating to the maintained PassWall installer.
REPO="hrostami/openclash-auto-installer"
BRANCH="main"
TMP_SCRIPT="/tmp/passwall-installer-test.sh"
log() {
printf '%s\n' "==> $*"
}
die() {
printf '%s\n' "[ERROR] $*" >&2
exit 1
}
if [ -f "./passwall.sh" ]; then
log "test-auto-download.sh Merged into passwall.sh, transferred to the local passwall.sh"
exec sh ./passwall.sh "$@"
fi
command -v curl >/dev/null 2>&1 || die "Lack curl command, unable to download passwall.sh"
log "test-auto-download.sh Merged into passwall.sh, download the latest passwall.sh"
curl -fsSL --retry 3 "https://raw.githubusercontent.com/$REPO/$BRANCH/passwall.sh" -o "$TMP_SCRIPT" || die "download passwall.sh fail"
exec sh "$TMP_SCRIPT" "$@"