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 12:17:59 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-10-04 14:41:52 +0300
commitc3ce1da0d6090c2d6019dc2049dde908f7288a99 (patch)
tree646bf337c6232defb5f25843b99a8cc7b627e587 /x-ui.sh
parent02bc488c1c1024e9be44ae3cfdf678b20bb4d6b3 (diff)
Web base path will be generated randomly
Diffstat (limited to 'x-ui.sh')
-rw-r--r--x-ui.sh11
1 files changed, 6 insertions, 5 deletions
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