Skip to content

Commit d95611a

Browse files
authored
Update x-ui-pro.sh
- Fix Auto SSL - Fix CronJob Auto SSL Command - Fix Package Installer - Fix Package Uninstaller
1 parent 219cbaa commit d95611a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

x-ui-pro.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
#################### x-ui-pro v11.9.5 @ github.com/GFW4Fun ##############################################
2+
#################### x-ui-pro v12.0.0 @ github.com/GFW4Fun ##############################################
33
[[ $EUID -ne 0 ]] && { echo "not root!"; exec sudo "$0" "$@"; }
44
msg() { echo -e "\e[1;37;40m $1 \e[0m";}
55
msg_ok() { echo -e "\e[1;32;40m $1 \e[0m";}
@@ -14,7 +14,7 @@ msg_inf ' _/ \_ |_____| __|__ | | \_ |_____|';
1414
hrline
1515
##################################Random Port and Path ###################################################
1616
mkdir -p ${HOME}/.cache
17-
Pak=$(command -v apt||echo dnf);
17+
Pak=$(command -v apt || command -v dnf); Pak=${Pak:-apt}
1818
gen_str() { l=$((RANDOM%7+6)); LC_CTYPE=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c $l; }
1919
RNDSTR=$(gen_str)
2020
RNDSTR2=$(gen_str)
@@ -143,7 +143,6 @@ if [[ "${UNINSTALL}" == *"y"* ]]; then
143143
systemctl stop "$service" > /dev/null 2>&1
144144
systemctl disable "$service" > /dev/null 2>&1
145145
done
146-
#bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
147146
printf 'n' | bash <(wget -qO- https://github.com/v2rayA/v2rayA-installer/raw/main/uninstaller.sh)
148147
rm -rf /etc/warp-plus/ /etc/nginx/sites-enabled/*
149148
crontab -l | grep -v "nginx\|systemctl\|x-ui\|v2ray" | crontab -
@@ -164,12 +163,13 @@ if [[ "${SubDomain}.${MainDomain}" != "${domain}" ]] ; then
164163
MainDomain=${domain}
165164
fi
166165
###############################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
172171
done
172+
173173
service_enable "nginx" "tor" "cron" "crond"
174174
############################### Get nginx Ver and Stop ##################################################
175175
vercompare() {
@@ -448,7 +448,6 @@ Restart=on-abort
448448
WantedBy=multi-user.target
449449
EOF
450450
##########################################Install v2ray-core + v2rayA-webui#############################
451-
#bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
452451
sudo sh -c "$(wget -qO- https://github.com/v2rayA/v2rayA-installer/raw/main/installer.sh)" @ --with-xray
453452
service_enable "v2raya" "warp-plus"
454453
######################cronjob for ssl/reload service/cloudflareips######################################

0 commit comments

Comments
 (0)