Skip to content

Commit

Permalink
if webBasePath lt 3 will be replace with new random
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Oct 4, 2024
1 parent decac2e commit f0dd615
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0dd615

Please sign in to comment.