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-04 16:47:16 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-10-04 17:05:45 +0300
commitf0dd6152fdcb9a58dbc37f1581dd083e72b420a8 (patch)
treedd80bc2a0d46f8072275a9f63a4068ec12ac3675 /install.sh
parentdecac2ef74464de472ad36a650f886cd3a4bd55e (diff)
if webBasePath lt 3 will be replace with new random
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index 76a88aa4..916adb90 100644
--- a/install.sh
+++ b/install.sh
@@ -184,10 +184,13 @@ config_after_install() {
else
echo -e "${yellow}This is your upgrade, keeping old settings. If you forgot your login info, you can type 'x-ui settings' to check${plain}"
- local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: [^ ]+' | awk '{print $2}')
- if [[ -z "$existing_webBasePath" ]]; then
- echo -e "${yellow}WebBasePath is empty, generating a random one: ${config_webBasePath}${plain}"
+ local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
+
+ if [[ ${#existing_webBasePath} -lt 3 ]]; then
+ echo -e "${yellow}WebBasePath is empty, generating a random one...${plain}"
+
/usr/local/x-ui/x-ui setting -webBasePath "${config_webBasePath}"
+ echo -e "${green}New webBasePath: ${config_webBasePath}${plain}"
fi
fi
fi