From c3ce1da0d6090c2d6019dc2049dde908f7288a99 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Fri, 4 Oct 2024 11:17:59 +0200 Subject: Web base path will be generated randomly --- x-ui.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'x-ui.sh') diff --git a/x-ui.sh b/x-ui.sh index e4bc622b..545b1af5 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -265,12 +265,13 @@ gen_random_string() { reset_webbasepath() { echo -e "${yellow}Resetting Web Base Path${plain}" - # Prompt user to set a new web base path - read -rp "Please set the new web base path [press 'y' for a random path]: " config_webBasePath - - if [[ $config_webBasePath == "y" ]]; then - config_webBasePath=$(gen_random_string 10) + read -rp "Are you sure you want to reset the web base path? (y/n): " confirm + if [[ $confirm != "y" && $confirm != "Y" ]]; then + echo -e "${yellow}Operation canceled.${plain}" + return fi + + config_webBasePath=$(gen_random_string 10) # Apply the new web base path setting /usr/local/x-ui/x-ui setting -webBasePath "${config_webBasePath}" >/dev/null 2>&1 -- cgit v1.2.3