-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest
299 lines (262 loc) · 8.94 KB
/
test
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
#!/bin/bash
module="$(pwd)/module"
rm -rf ${module}
wget -O ${module} "https://raw.githubusercontent.com/rudi9999/Herramientas/main/module/module" &>/dev/null
[[ ! -e ${module} ]] && exit
chmod +x ${module} &>/dev/null
source ${module}
CTRL_C(){
rm -rf ${module}; exit
}
if [[ ! $(id -u) = 0 ]]; then
clear
msg -bar
print_center -ama "ERROR DE EJECUCION"
msg -bar
print_center -ama "DEVE EJECUTAR DESDE EL USUSRIO ROOT"
msg -bar
CTRL_C
fi
trap "CTRL_C" INT TERM EXIT
ADMRufu="/etc/ADMRufu" && [[ ! -d ${ADMRufu} ]] && mkdir ${ADMRufu}
ADM_inst="${ADMRufu}/install" && [[ ! -d ${ADM_inst} ]] && mkdir ${ADM_inst}
tmp="${ADMRufu}/tmp" && [[ ! -d ${tmp} ]] && mkdir ${tmp}
SCPinstal="$HOME/install"
#rm -rf /etc/localtime &>/dev/null
#ln -s /usr/share/zoneinfo/America/Argentina/Tucuman /etc/localtime &>/dev/null
cp -f $0 ${ADMRufu}/install.sh
rm $(pwd)/$0 &> /dev/null
if [[ $(which install-LIC) = "" ]]; then
wget -O /usr/bin/install-LIC 'https://github.com/rudi9999/Rufu-LIC/raw/main/install-LIC'; chmod +x /usr/bin/install-LIC &>/dev/null
fi
install-LIC
[[ $? = 1 ]] && exit
stop_install(){
title "INSTALACION CANCELADA"
exit
}
time_reboot(){
print_center -ama "REINICIANDO VPS EN $1 SEGUNDOS"
REBOOT_TIMEOUT="$1"
while [ $REBOOT_TIMEOUT -gt 0 ]; do
print_center -ne "-$REBOOT_TIMEOUT-\r"
sleep 1
: $((REBOOT_TIMEOUT--))
done
reboot
}
repo_install(){
link="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Repositorios/$VERSION_ID.list"
case $VERSION_ID in
8*|9*|10*|11*|16.04*|18.04*|20.04*|20.10*|21.04*|21.10*|22.04*) [[ ! -e /etc/apt/sources.list.back ]] && cp /etc/apt/sources.list /etc/apt/sources.list.back
wget -O /etc/apt/sources.list ${link} &>/dev/null;;
esac
}
dependencias(){
soft="sudo bsdmainutils zip unzip ufw curl python python3 python3-pip openssl screen cron iptables lsof nano at mlocate gawk grep bc jq curl npm nodejs socat netcat netcat-traditional net-tools cowsay figlet lolcat"
for install in $soft; do
leng="${#install}"
puntos=$(( 21 - $leng))
pts="."
for (( a = 0; a < $puntos; a++ )); do
pts+="."
done
msg -nazu " instalando $install $(msg -ama "$pts")"
if apt install $install -y &>/dev/null ; then
msg -verd "INSTALL"
else
msg -verm2 "FAIL"
sleep 2
del 1
if [[ $install = "python" ]]; then
pts=$(echo ${pts:1})
msg -nazu " instalando python2 $(msg -ama "$pts")"
if apt install python2 -y &>/dev/null ; then
[[ ! -e /usr/bin/python ]] && ln -s /usr/bin/python2 /usr/bin/python
msg -verd "INSTALL"
else
msg -verm2 "FAIL"
fi
continue
fi
print_center -ama "aplicando fix a $install"
dpkg --configure -a &>/dev/null
sleep 2
del 1
msg -nazu " instalando $install $(msg -ama "$pts")"
if apt install $install -y &>/dev/null ; then
msg -verd "INSTALL"
else
msg -verm2 "FAIL"
fi
fi
done
}
verificar_arq(){
unset ARQ
case $1 in
menu|menu_inst.sh|tool_extras.sh|chekup.sh|bashrc)ARQ="${ADMRufu}";;
ADMRufu)ARQ="/usr/bin";;
message.txt)ARQ="${tmp}";;
*)ARQ="${ADM_inst}";;
esac
mv -f ${SCPinstal}/$1 ${ARQ}/$1
chmod +x ${ARQ}/$1
}
error_fun(){
msg -bar3
print_center -verm "ERROR de enlace VPS<-->GENERADOR"
msg -bar3
[[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
exit
}
post_reboot(){
echo 'clear; sleep 2; /etc/ADMRufu/install.sh --continue' >> /root/.bashrc
title "INSTALADOR ADMRufu"
print_center -ama "La instalacion continuara\ndespues del reinicio!!!"
msg -bar
}
install_start(){
title "INSTALADOR ADMRufu"
print_center -ama "A continuacion se actualizaran los paquetes\ndel systema. Esto podria tomar tiempo,\ny requerir algunas preguntas\npropias de las actualizaciones."
msg -bar3
read -rp "$(msg -verm2 " Desea continuar? [S/N]:") " -e -i S opcion
[[ "$opcion" != @(s|S) ]] && stop_install
title "INSTALADOR ADMRufu"
print_center -ama 'Esto modificara la hora y fecha automatica\nsegun la Zona horaria establecida.'
msg -bar
read -rp "$(msg -ama " Modificar la zona horaria? [S/N]:") " -e -i N opcion
[[ "$opcion" != @(n|N) ]] && source <(curl -sSL "https://raw.githubusercontent.com/rudi9999/ADMRufu/main/online/timeZone.sh")
title "INSTALADOR ADMRufu"
repo_install
mysis=$(echo "$VERSION_ID"|cut -d '.' -f1)
#[[ ! $mysis = '22' ]] && add-apt-repository -y ppa:ondrej/php &>/dev/null
apt update -y; apt upgrade -y
[[ "$VERSION_ID" = '9' ]] && source <(curl -sL https://deb.nodesource.com/setup_10.x)
}
install_continue(){
title "INSTALADOR ADMRufu"
print_center -ama "$PRETTY_NAME"
print_center -verd "INSTALANDO DEPENDENCIAS"
msg -bar3
dependencias
msg -bar3
print_center -azu "Removiendo paquetes obsoletos"
apt autoremove -y &>/dev/null
[[ "$VERSION_ID" = '9' ]] && apt remove unscd -y &>/dev/null
sleep 2
tput cuu1 && tput dl1
print_center -ama "si algunas de las dependencias falla!!!\nal terminar, puede intentar instalar\nla misma manualmente usando el siguiente comando\napt install nom_del_paquete"
enter
}
source /etc/os-release; export PRETTY_NAME
while :
do
case $1 in
-s|--start)install_start; post_reboot; time_reboot "15";;
-c|--continue)sed -i '/Rufu/d' /root/.bashrc
install_continue
break;;
-u|--update)install_start
rm -rf /etc/ADMRufu/tmp/style
install_continue
break;;
-t|--test)break;;
*)exit;;
esac
done
title "INSTALADOR ADMRufu"
fun_ip
msg -ne " Verificando Datos: "
cd $HOME
arch='ADMRufu
bashrc
budp.sh
cert.sh
chekup.sh
chekuser.sh
confDNS.sh
domain.sh
filebrowser.sh
limitador.sh
menu
menu_inst.sh
openvpn.sh
PDirect.py
PGet.py
POpen.py
PPriv.py
PPub.py
slowdns.sh
sockspy.sh
squid.sh
swapfile.sh
tcpbbr.sh
tool_extras.sh
userHWID
userSSH
userTOKEN
userV2ray.sh
userWG.sh
v2ray.sh
wireguard.sh
ws-cdn.sh
WS-Proxy.js'
lisArq="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/old"
ver=$(curl -sSL "https://raw.githubusercontent.com/rudi9999/ADMRufu/main/vercion")
echo "$ver" > ${ADMRufu}/vercion
title -ama '[Proyect by @Rufu99]'
print_center -ama 'INSTALANDO SCRIPT ADMRufu'
sleep 2; del 1
[[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
print_center -ama 'Descarga de archivos.....'
for arqx in $(echo $arch); do
echo "Descargando: ${arqx}"
wget --no-check-certificate -O ${SCPinstal}/${arqx} ${lisArq}/${arqx} && {
verificar_arq "${arqx}"
} || {
del 1
print_center -verm2 'Instalacion fallida'
sleep 2s
error_fun
}
done
url='https://github.com/rudi9999/ADMRufu/raw/main/Utils'
autoStart="${ADMRufu}/bin" && [[ ! -d $autoStart ]] && mkdir $autoStart
varEntorno="${ADMRufu}/sbin" && [[ ! -d $varEntorno ]] && mkdir $varEntorno
wget -O $autoStart/autoStart "$url/autoStart/autoStart"; chmod +x $autoStart/autoStart
wget -O $autoStart/auto-update "$url/auto-update/auto-update"; chmod +x $autoStart/auto-update
wget -O ${ADMRufu}/install/cmd "$url/mine_port/cmd"; chmod +x ${ADMRufu}/install/cmd
wget -O ${ADMRufu}/install/udp-custom "$url/udp-custom/udp-custom"; chmod +x ${ADMRufu}/install/udp-custom
wget -O ${ADMRufu}/install/psiphon-manager "$url/psiphon/psiphon-manager"; chmod +x ${ADMRufu}/install/psiphon-manager
wget -O ${varEntorno}/dropBear "$url/dropBear/dropBear"; chmod +x ${varEntorno}/dropBear
wget -O ${varEntorno}/protocolsUDP "$url/protocolsUDP/protocolsUDP"; chmod +x ${varEntorno}/protocolsUDP
wget -O ${varEntorno}/udprequest "$url/protocolsUDP/udprequest/udprequest"; chmod +x ${varEntorno}/udprequest
wget -O ${varEntorno}/udpcustom "$url/protocolsUDP/udpcustom/udpcustom"; chmod +x ${varEntorno}/udpcustom
wget -O ${varEntorno}/udp-zivpn "$url/protocolsUDP/zivpn/udp-zivpn"; chmod +x ${varEntorno}/udp-zivpn
wget -O ${varEntorno}/udp-udpmod "$url/protocolsUDP/udpmod/udp-udpmod"; chmod +x ${varEntorno}/udp-udpmod
wget -O ${varEntorno}/Stunnel "$url/Stunnel/Stunnel"; chmod +x ${varEntorno}/Stunnel
wget -O ${varEntorno}/monitor "$url/user-manager/monitor/monitor"; chmod +x ${varEntorno}/monitor
wget -O ${varEntorno}/online "$url/user-manager/monitor/online/online"; chmod +x ${varEntorno}/online
if [[ -e $autoStart/autoStart ]]; then
$autoStart/autoStart -e /etc/ADMRufu/autoStart
fi
del 1
print_center -verd 'Instalacion completa'
sleep 2s
rm $HOME/lista-arq
[[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
rm -rf /usr/bin/menu
rm -rf /usr/bin/adm
ln -s /usr/bin/ADMRufu /usr/bin/menu
ln -s /usr/bin/ADMRufu /usr/bin/adm
ln -s /etc/ADMRufu/reseller /etc/ADMRufu/tmp/message.txt
sed -i '/Rufu/d' /etc/bash.bashrc
sed -i '/Rufu/d' /root/.bashrc
echo '[[ -e /etc/ADMRufu/bashrc ]] && source /etc/ADMRufu/bashrc' >> /etc/bash.bashrc
update-locale LANG=en_US.UTF-8 LANGUAGE=en
[[ ! $(cat /etc/shells|grep "/bin/false") ]] && echo -e "/bin/false" >> /etc/shells
clear
title "-- ADMRufu INSTALADO --"
mv -f ${module} /etc/ADMRufu/module
time_reboot "10"