diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-04 12:17:59 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-10-04 14:41:52 +0300 |
| commit | c3ce1da0d6090c2d6019dc2049dde908f7288a99 (patch) | |
| tree | 646bf337c6232defb5f25843b99a8cc7b627e587 /x-ui.sh | |
| parent | 02bc488c1c1024e9be44ae3cfdf678b20bb4d6b3 (diff) | |
Web base path will be generated randomly
Diffstat (limited to 'x-ui.sh')
| -rw-r--r-- | x-ui.sh | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |
