Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2024-10-29 17:07:56 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-10-29 17:20:38 +0300
commit13f7e071285f57327c8c741d5c691ddf2a9f9621 (patch)
tree92d05477d13a123294002d40a779a1fa48fc5097 /x-ui.sh
parent0e3691fdbd5d760298e761b6f483abcbcfb07c77 (diff)
bash - Access URL
I will add https with domain later
Diffstat (limited to 'x-ui.sh')
-rw-r--r--x-ui.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/x-ui.sh b/x-ui.sh
index e09d0b05..7d669d5f 100644
--- a/x-ui.sh
+++ b/x-ui.sh
@@ -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() {