1
1
#! /bin/bash
2
- # ################### x-ui-pro v11.9.5 @ github.com/GFW4Fun ##############################################
2
+ # ################### x-ui-pro v12.0.0 @ github.com/GFW4Fun ##############################################
3
3
[[ $EUID -ne 0 ]] && { echo " not root!" ; exec sudo " $0 " " $@ " ; }
4
4
msg () { echo -e " \e[1;37;40m $1 \e[0m" ; }
5
5
msg_ok () { echo -e " \e[1;32;40m $1 \e[0m" ; }
@@ -14,7 +14,7 @@ msg_inf ' _/ \_ |_____| __|__ | | \_ |_____|';
14
14
hrline
15
15
# #################################Random Port and Path ###################################################
16
16
mkdir -p ${HOME} /.cache
17
- Pak=$( command -v apt|| echo dnf) ;
17
+ Pak=$( command -v apt || command -v dnf) ; Pak= ${Pak :- apt}
18
18
gen_str () { l=$(( RANDOM% 7 + 6 )) ; LC_CTYPE=C tr -dc ' A-Za-z0-9' < /dev/urandom | head -c $l ; }
19
19
RNDSTR=$( gen_str)
20
20
RNDSTR2=$( gen_str)
@@ -143,7 +143,6 @@ if [[ "${UNINSTALL}" == *"y"* ]]; then
143
143
systemctl stop " $service " > /dev/null 2>&1
144
144
systemctl disable " $service " > /dev/null 2>&1
145
145
done
146
- # bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
147
146
printf ' n' | bash <( wget -qO- https://github.com/v2rayA/v2rayA-installer/raw/main/uninstaller.sh)
148
147
rm -rf /etc/warp-plus/ /etc/nginx/sites-enabled/*
149
148
crontab -l | grep -v " nginx\|systemctl\|x-ui\|v2ray" | crontab -
@@ -164,12 +163,13 @@ if [[ "${SubDomain}.${MainDomain}" != "${domain}" ]] ; then
164
163
MainDomain=${domain}
165
164
fi
166
165
# ##############################Install Packages#########################################################
167
- $Pak -y purge sqlite
168
- $Pak -y purge sqlite3
169
- $Pak -y update
170
- for pkg in epel-release cronie psmisc unzip curl nginx nginx-full python3 certbot python3-certbot-nginx sqlite sqlite3 jq openssl tor tor-geoipdb; do
171
- dpkg -l " $pkg " & > /dev/null || rpm -q " $pkg " & > /dev/null || $Pak -y install " $pkg "
166
+ sudo $Pak -y purge sqlite sqlite3 python3-certbot-nginx 2> /dev/null || true
167
+ [[ $Pak == * apt ]] && sudo apt update || sudo dnf makecache
168
+
169
+ for p in epel-release cronie psmisc unzip curl nginx nginx-full python3 certbot python3-certbot-nginx sqlite sqlite3 jq openssl tor tor-geoipdb; do
170
+ (command -v dpkg& > /dev/null && dpkg -l $p & > /dev/null) || ( rpm -q $p & > /dev/null) || sudo $Pak -y install $p
172
171
done
172
+
173
173
service_enable " nginx" " tor" " cron" " crond"
174
174
# ############################## Get nginx Ver and Stop ##################################################
175
175
vercompare () {
@@ -448,7 +448,6 @@ Restart=on-abort
448
448
WantedBy=multi-user.target
449
449
EOF
450
450
# #########################################Install v2ray-core + v2rayA-webui#############################
451
- # bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
452
451
sudo sh -c " $( wget -qO- https://github.com/v2rayA/v2rayA-installer/raw/main/installer.sh) " @ --with-xray
453
452
service_enable " v2raya" " warp-plus"
454
453
# #####################cronjob for ssl/reload service/cloudflareips######################################
0 commit comments