diff --git a/update.sh b/update.sh index 36b501c1f..f801d0134 100755 --- a/update.sh +++ b/update.sh @@ -751,6 +751,8 @@ prompt_and_setup_ssl() { } config_after_update() { + local panel_needs_restart=0 + echo -e "${yellow}x-ui settings:${plain}" ${xui_folder}/x-ui setting -show true ${xui_folder}/x-ui migrate @@ -798,6 +800,7 @@ config_after_update() { local config_webBasePath=$(gen_random_string 18) ${xui_folder}/x-ui setting -webBasePath "${config_webBasePath}" existing_webBasePath="${config_webBasePath}" + panel_needs_restart=1 echo -e "${green}New WebBasePath: ${config_webBasePath}${plain}" fi @@ -832,6 +835,11 @@ config_after_update() { echo -e "${green}Access URL: https://${cert_domain}:${existing_port}/${existing_webBasePath}${plain}" echo -e "${green}═══════════════════════════════════════════${plain}" fi + + if [[ "$panel_needs_restart" -eq 1 ]]; then + echo -e "${yellow}Restarting panel to apply the new web base path...${plain}" + systemctl restart x-ui 2> /dev/null || rc-service x-ui restart 2> /dev/null + fi } update_x-ui() {