diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-29 17:07:56 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-29 17:20:38 +0300 |
| commit | 13f7e071285f57327c8c741d5c691ddf2a9f9621 (patch) | |
| tree | 92d05477d13a123294002d40a779a1fa48fc5097 /x-ui.sh | |
| parent | 0e3691fdbd5d760298e761b6f483abcbcfb07c77 (diff) | |
bash - Access URL
I will add https with domain later
Diffstat (limited to 'x-ui.sh')
| -rw-r--r-- | x-ui.sh | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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() { |
