bash - Access URL

I will add https with domain later
This commit is contained in:
mhsanaei
2024-10-29 15:07:56 +01:00
parent 0e3691fdbd
commit 13f7e07128
2 changed files with 13 additions and 2 deletions
+8 -1
View File
@@ -308,12 +308,19 @@ reset_config() {
}
check_config() {
info=$(/usr/local/x-ui/x-ui setting -show true)
local info=$(/usr/local/x-ui/x-ui setting -show true)
if [[ $? != 0 ]]; then
LOGE "get current settings error, please check logs"
show_menu
return
fi
LOGI "${info}"
local existing_webBasePath=$(echo "$info" | grep -Eo 'webBasePath: .+' | awk '{print $2}')
local existing_port=$(echo "$info" | grep -Eo 'port: .+' | awk '{print $2}')
local server_ip=$(curl -s https://api.ipify.org)
echo -e "${green}Access URL: http://${server_ip}:${existing_port}${existing_webBasePath}${plain}"
}
set_port() {