710
710
rm -rf tempvmess.json temphy2.json tmpsocks5.json
711
711
}
712
712
713
+ isServ00 (){
714
+ return $( hostname | grep ' serv00' )
715
+ }
716
+
713
717
# 获取端口
714
718
getPort (){
715
719
local type=$1
@@ -724,7 +728,7 @@ getPort(){
724
728
else
725
729
# echo "devil port add $type random $opts"
726
730
rt=$( devil port add $type random $opts )
727
- if [[ " $rt " =~ .* succesfully.* $ ]]; then
731
+ if [[ " $rt " =~ .* succesfully.* $ || " $rt " =~ . * Ok. * $ ]]; then
728
732
loadPort
729
733
if [[ -n " $port_array [" $key " ]" ]]; then
730
734
echo " ${port_array["$key"]} "
@@ -1558,7 +1562,11 @@ update_http_port() {
1558
1562
installAlist (){
1559
1563
cd ${installpath} /serv00-play/ || return 1
1560
1564
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
1562
1570
host=" $( hostname | cut -d ' .' -f 1) "
1563
1571
sno=${host/ s/ web}
1564
1572
webpath=" ${installpath} /domains/$domain /public_html/"
@@ -1585,8 +1593,8 @@ installAlist(){
1585
1593
fi
1586
1594
echo " 正在安装alist,请等待..."
1587
1595
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
1590
1598
if [[ ! " $resp " =~ " This domain already exists" ]]; then
1591
1599
red " 申请域名$domain 失败!"
1592
1600
return 1
@@ -1595,7 +1603,7 @@ installAlist(){
1595
1603
webIp=$( devil vhost list public | grep " $sno " | awk ' {print $1}' )
1596
1604
resp=$( devil ssl www add $webIp le le $domain )
1597
1605
1598
- if [[ ! " $resp " =~ .* succesfully.* $ ]]; then
1606
+ if [[ ! " $resp " =~ .* succesfully.* $ && ! " $resp " =~ . * Ok. * $ ]]; then
1599
1607
red " 申请ssl证书失败!$resp "
1600
1608
read -p " 是否可以不要证书使用,后面自己再申请证书? [y/n] [y]:" input
1601
1609
input=${input:- y}
@@ -1624,7 +1632,11 @@ checkAlistAlive(){
1624
1632
1625
1633
startAlist (){
1626
1634
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
1628
1640
webpath=" ${installpath} /domains/$domain /public_html/"
1629
1641
1630
1642
if [[ -d " $webpath /data" && -e " $webpath /alist" ]]; then
@@ -1668,7 +1680,11 @@ uninstallAlist(){
1668
1680
user=" $( whoami) "
1669
1681
host=" $( hostname | cut -d ' .' -f 1) "
1670
1682
sno=${host/ s/ web}
1683
+ if isServ00 ; then
1671
1684
domain=" alist.$user .serv00.net"
1685
+ else
1686
+ domain=" alist.$user .ct8.pl"
1687
+ fi
1672
1688
webIp=$( devil vhost list public | grep " $sno " | awk ' {print $1}' )
1673
1689
resp=$( devil ssl www del $webIp $domain )
1674
1690
resp=$( devil www del $domain --remove)
@@ -1679,7 +1695,11 @@ uninstallAlist(){
1679
1695
1680
1696
resetAdminPass (){
1681
1697
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
1683
1703
webpath=" ${installpath} /domains/$domain /public_html/"
1684
1704
1685
1705
cd $webpath
0 commit comments