-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
101 lines (90 loc) · 3.17 KB
/
setup.sh
File metadata and controls
101 lines (90 loc) · 3.17 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/bash
############################################################################
# Copyright (c) 2024 Tony-Linux. All rights reserved. #
# If you want a useful project like this contact us: #
# pucham@proton.me #
# You can also create similar projects in collaboration with us #
# Invite: mr-fidal #
# This code is copyrighted and may not be copied or edited without the #
# express written permission of the copyright holder. #
############################################################################
green='\033[1;32m'
red='\033[1;31m'
white='\033[1;37m'
cyan='\033[0;36m'
packages()
{
if [[ $(command -v python3) ]]; then
echo -e "${white} [${green}+${white}] ${green}Python 3 is installed."
else
echo -e "${white} [${red}+${white}] ${red}Python 3 command not found. To install Python 3, please execute the installation command: 'apt install python3'."
exit
fi
if [[ $(command -v ruby) ]]; then
echo -e "${white} [${green}+${white}] ${green}Ruby is installed."
else
echo -e "${white} [${red}+${white}] ${red}Ruby command not found. To install Ruby, please execute the installation command: 'apt install ruby'."
exit
fi
if python3 -c "import requests" &> /dev/null; then
echo "${white} [${green}+${white}] ${green}Requests package is installed."
else
echo "${white} [${red}+${white}] ${red}Requests package not found. Please install it using: 'pip install requests'."
fi
}
verify_code()
{
if [[ $(command -v authnix) ]]; then
echo ""
else
exit
fi
}
setup_linux()
{
mkdir -p /usr/share/authnix
mkdir -p /usr/share/authnix/subdomain
mkdir -p /usr/share/authnix/password
mkdir -p /usr/share/authnix/hidden
cp -p password /usr/share/authnix/
cp -p src/authnix /usr/bin/
chmod +x /usr/bin/authnix
cp -p subdomain/domain.txt /usr/share/authnix/subdomain/
cp -p subdomain/authnixsubdomain /usr/bin/authnixsubdomain
chmod +x /usr/bin/authnixsubdomain
}
if [[ $(command -v authnix) ]]; then
echo "${white} [${green}+${white}] ${green}authnix is already installed on your system, please try again"
sleep 3
packages
else
echo ""
fi
setup_termux()
{
mkdir -p /data/data/com.termux/files/usr/share/authnix
mkdir -p /data/data/com.termux/files/usr/share/authnix/subdomain
mkdir -p /data/data/com.termux/files/usr/share/authnix/password
mkdir -p /data/data/com.termux/files/usr/share/authnix/hidden
cp -p password /data/data/com.termux/files/usr/share/authnix/
cp -p src/authnix /data/data/com.termux/files/usr/bin/
chmod +x /data/data/com.termux/files/usr/bin/authnix
cp -p subdomain/domain.txt /data/data/com.termux/files/usr/share/authnix/subdomain/
cp -p subdomain/authnixsubdomain /data/data/com.termux/files/usr/bin/
chmod +x /data/data/com.termux/files/usr/bin/authnixsubdomain
}
main()
{
if [[ -d /usr/bin ]]; then
if [ $(id -u) -ne 0 ]; then
echo -e "${white} [${red}+${white}] ${red}This script must be ran as root"
exit 1
fi
setup_linux
elif [[ -d /data/data/com.termux/files/home ]]; then
setup_termux
fi
}
main
packages
verify_code