-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall.sh
75 lines (58 loc) · 2.12 KB
/
install.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
install_python() {
echo "Installing Python..."
pkg update -y || { echo "Failed to update packages. Exiting."; exit 1; }
pkg install python -y || { echo "Failed to install Python. Exiting."; exit 1; }
pkg install python-pip -y || { echo "Failed to install Python. Exiting."; exit 1; }
}
install_git() {
echo "Installing Git..."
pkg install git -y || { echo "Failed to install Git. Exiting."; exit 1; }
pkg install python git -y || { echo "Failed to install Git Python. Exiting."; exit 1; }
}
install_wget() {
echo "Installing wget..."
pkg install wget -y || { echo "Failed to install wget. Exiting."; exit 1; }
}
install_curl() {
echo "Installing curl..."
pkg install curl -y || { echo "Failed to install curl. Exiting."; exit 1; }
}
if ! command -v python || ! command -v pip; then
install_python
fi
if ! command -v git; then
install_git
fi
if ! command -v wget; then
install_wget
fi
if ! command -v curl; then
install_curl
fi
if [ -f WarpScanner.py ]; then
first_line=$(head -n 1 WarpScanner.py)
if [ "$first_line" == "import urllib.request" ]; then
rm WarpScanner.py
echo "Updating WarpScanner.py..."
curl -fsSL -o WarpScanner.py https://raw.githubusercontent.com/arshiacomplus/WarpScanner/main/WarpScanner.py || { echo \"Failed to download WarpScanner.py. Exiting.\"; exit 1; }
python WarpScanner.py
exit 0
fi
fi
if [ -f WarpScanner.py ]; then
first_line=$(head -n 1 WarpScanner.py)
if [ "$first_line" != "V=70" ]; then
rm WarpScanner.py
echo "Updating WarpScanner.py..."
curl -fsSL -o WarpScanner.py https://raw.githubusercontent.com/arshiacomplus/WarpScanner/main/WarpScanner.py || { echo \"Failed to download WarpScanner.py. Exiting.\"; exit 1; }
python WarpScanner.py
exit 0
else
python WarpScanner.py
exit 0
fi
fi
echo "install WarpScanner.py"
curl -fsSL -o WarpScanner.py https://raw.githubusercontent.com/arshiacomplus/WarpScanner/main/WarpScanner.py || { echo \"Failed to download WarpScanner.py. Exiting.\"; exit 1; }
python WarpScanner.py