Skip to content

Commit 536778c

Browse files
authored
Update x-ui-pro.sh
1 parent e4ac71b commit 536778c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

x-ui-pro.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
#################### x-ui-pro v6.6.7 @ github.com/GFW4Fun ##############################################
2+
#################### x-ui-pro v6.6.8 @ github.com/GFW4Fun ##############################################
33
[[ $EUID -ne 0 ]] && echo "not root!" && sudo su -
44
##############################INFO######################################################################
55
msg_ok() { echo -e "\e[1;42m $1 \e[0m";}
@@ -297,20 +297,22 @@ else
297297
msg_err "$MainDomain nginx config not exist!" && exit 1
298298
fi
299299

300+
systemctl start nginx
301+
300302
if [[ $(nginx -t 2>&1 | grep -o 'successful') != "successful" ]]; then
301303
msg_err "nginx config is not ok!"
302304
systemctl restart nginx
303-
else
304-
systemctl start nginx
305-
x-ui start > /dev/null 2>&1
306305
fi
306+
307+
x-ui start > /dev/null 2>&1
307308
######################cronjob for ssl/reload service/cloudflareips######################################
308309
crontab -l | grep -v "certbot\|x-ui\|cloudflareips" | crontab -
309310
(crontab -l 2>/dev/null; echo '@daily sudo systemctl restart x-ui nginx tor > /dev/null 2>&1;') | crontab -
310311
(crontab -l 2>/dev/null; echo '@weekly bash /etc/nginx/cloudflareips.sh > /dev/null 2>&1;') | crontab -
311312
(crontab -l 2>/dev/null; echo '@monthly certbot renew --nginx --force-renewal --non-interactive --post-hook "nginx -s reload" > /dev/null 2>&1;') | crontab -
312313
##################################Show Details##########################################################
313-
if systemctl is-active --quiet x-ui; then clear
314+
if ls /etc/systemd/system/ | grep -q x-ui; then
315+
clear
314316
printf '0\n' | x-ui | grep --color=never -i ':'
315317
msg_inf "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
316318
nginx -T | grep -i 'ssl_certificate\|ssl_certificate_key'

0 commit comments

Comments
 (0)