From 771d6e04ba54000e6485c75d9c82fbae1f9c19ce Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 3 Feb 2023 13:39:45 +0800 Subject: [PATCH] Update mw.tpl --- scripts/init.d/mw.tpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index fae1bd3a9..c40a02424 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -313,11 +313,19 @@ case "$1" in auth_path=$(cat $mw_path/data/admin_path.pl) fi - if [ "$address" = "" ];then + if [ "$address" == "" ];then v4=$(python3 $mw_path/tools.py getServerIp 4) v6=$(python3 $mw_path/tools.py getServerIp 6) if [ "$v4" != "" ] && [ "$v6" != "" ]; then + + if [ ! -f $mw_path/data/ipv6.pl ];then + # Need to restart ipv6 to take effect + echo 'True' > $mw_path/data/ipv6.pl + mw_stop + mw_start + fi + address="MW-Panel-Url-Ipv4: http://$v4:$port$auth_path \nMW-Panel-Url-Ipv6: http://[$v6]:$port$auth_path" elif [ "$v4" != "" ]; then address="MW-Panel-Url: http://$v4:$port$auth_path"