Skip to content

Commit 9dad74d

Browse files
committed
兼容一下ct8.pl
1 parent 25e22b1 commit 9dad74d

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

start.sh

+27-7
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,10 @@ EOF
710710
rm -rf tempvmess.json temphy2.json tmpsocks5.json
711711
}
712712

713+
isServ00(){
714+
return $(hostname | grep 'serv00' )
715+
}
716+
713717
#获取端口
714718
getPort(){
715719
local type=$1
@@ -724,7 +728,7 @@ getPort(){
724728
else
725729
# echo "devil port add $type random $opts"
726730
rt=$(devil port add $type random $opts)
727-
if [[ "$rt" =~ .*succesfully.*$ ]]; then
731+
if [[ "$rt" =~ .*succesfully.*$ || "$rt" =~ .*Ok.*$ ]]; then
728732
loadPort
729733
if [[ -n "$port_array["$key"]" ]]; then
730734
echo "${port_array["$key"]}"
@@ -1558,7 +1562,11 @@ update_http_port() {
15581562
installAlist(){
15591563
cd ${installpath}/serv00-play/ || return 1
15601564
user="$(whoami)"
1561-
domain="alist.$user.serv00.net"
1565+
if isServ00 ; then
1566+
domain="alist.$user.serv00.net"
1567+
else
1568+
domain="alist.$user.ct8.pl"
1569+
fi
15621570
host="$(hostname | cut -d '.' -f 1)"
15631571
sno=${host/s/web}
15641572
webpath="${installpath}/domains/$domain/public_html/"
@@ -1585,8 +1593,8 @@ installAlist(){
15851593
fi
15861594
echo "正在安装alist,请等待..."
15871595
resp=$(devil www add $domain proxy localhost $alist_port)
1588-
1589-
if [[ ! "$resp" =~ .*succesfully.*$ ]]; then
1596+
echo "resp:$resp"
1597+
if [[ ! "$resp" =~ .*succesfully.*$ && ! "$resp" =~ .*Ok.*$ ]]; then
15901598
if [[ ! "$resp" =~ "This domain already exists" ]]; then
15911599
red "申请域名$domain 失败!"
15921600
return 1
@@ -1595,7 +1603,7 @@ installAlist(){
15951603
webIp=$(devil vhost list public | grep "$sno" | awk '{print $1}')
15961604
resp=$(devil ssl www add $webIp le le $domain)
15971605

1598-
if [[ ! "$resp" =~ .*succesfully.*$ ]]; then
1606+
if [[ ! "$resp" =~ .*succesfully.*$ && ! "$resp" =~ .*Ok.*$ ]]; then
15991607
red "申请ssl证书失败!$resp"
16001608
read -p "是否可以不要证书使用,后面自己再申请证书? [y/n] [y]:" input
16011609
input=${input:-y}
@@ -1624,7 +1632,11 @@ checkAlistAlive(){
16241632

16251633
startAlist(){
16261634
user="$(whoami)"
1627-
domain="alist.$user.serv00.net"
1635+
if isServ00 ; then
1636+
domain="alist.$user.serv00.net"
1637+
else
1638+
domain="alist.$user.ct8.pl"
1639+
fi
16281640
webpath="${installpath}/domains/$domain/public_html/"
16291641

16301642
if [[ -d "$webpath/data" && -e "$webpath/alist" ]]; then
@@ -1668,7 +1680,11 @@ uninstallAlist(){
16681680
user="$(whoami)"
16691681
host="$(hostname | cut -d '.' -f 1)"
16701682
sno=${host/s/web}
1683+
if isServ00 ; then
16711684
domain="alist.$user.serv00.net"
1685+
else
1686+
domain="alist.$user.ct8.pl"
1687+
fi
16721688
webIp=$(devil vhost list public | grep "$sno" | awk '{print $1}')
16731689
resp=$(devil ssl www del $webIp $domain)
16741690
resp=$(devil www del $domain --remove)
@@ -1679,7 +1695,11 @@ uninstallAlist(){
16791695

16801696
resetAdminPass(){
16811697
user="$(whoami)"
1682-
domain="alist.$user.serv00.net"
1698+
if isServ00 ; then
1699+
domain="alist.$user.serv00.net"
1700+
else
1701+
domain="alist.$user.ct8.pl"
1702+
fi
16831703
webpath="${installpath}/domains/$domain/public_html/"
16841704

16851705
cd $webpath

0 commit comments

Comments
 (0)