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-09 12:15:37 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2024-10-09 12:18:09 +0300
commite37f2d322256ed4468fd0277b0cb10a5bf4ccaa9 (patch)
treecec83baaf45985de2ed4d0d63c714a1d32f42095 /install.sh
parent4f2f855c04322bb64f32cfb695878e946c4359e8 (diff)
Username & Password will be generated randomly
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh30
1 files changed, 13 insertions, 17 deletions
diff --git a/install.sh b/install.sh
index 2926f6b3..c4cc6798 100644
--- a/install.sh
+++ b/install.sh
@@ -138,27 +138,25 @@ gen_random_string() {
config_after_install() {
echo -e "${yellow}Install/update finished! For security, it's recommended to modify panel settings ${plain}"
- read -p "Would you like to customize the panel settings? (If not, random settings will be applied) [y/n]: " config_confirm
+ read -p "Would you like to customize ${yellow}the Panel Port ${plain}settings? (If not, random settings will be applied) [y/n]: " config_confirm
- local config_webBasePath=$(gen_random_string 10)
+ local config_webBasePath=$(gen_random_string 15)
+ local config_account=$(gen_random_string 10)
+ local config_password=$(gen_random_string 10)
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
- read -p "Please set up your username: " config_account
- echo -e "${yellow}Your username will be: ${config_account}${plain}"
-
- read -p "Please set up your password: " config_password
- echo -e "${yellow}Your password will be: ${config_password}${plain}"
-
read -p "Please set up the panel port: " config_port
- echo -e "${yellow}Your panel port is: ${config_port}${plain}"
+ echo -e "${yellow}Your Panel Port is: ${config_port}${plain}"
- echo -e "${yellow}Your web base path will be generated randomly: ${config_webBasePath}${plain}"
+ echo -e "${yellow}Your Username will be generated randomly: ${config_account}${plain}"
+ echo -e "${yellow}Your Password will be generated randomly: ${config_password}${plain}"
+ echo -e "${yellow}Your Web Base Path will be generated randomly: ${config_webBasePath}${plain}"
echo -e "${yellow}Initializing, please wait...${plain}"
/usr/local/x-ui/x-ui setting -username "${config_account}" -password "${config_password}" -port "${config_port}" -webBasePath "${config_webBasePath}"
- echo -e "${yellow}Settings applied successfully!${plain}"
+ echo -e "${green}Settings applied successfully!${plain}"
echo -e "###############################################"
echo -e "${green}Username: ${config_account}${plain}"
@@ -173,15 +171,13 @@ config_after_install() {
if [[ ! -f "/etc/x-ui/x-ui.db" ]]; then
- local usernameTemp=$(gen_random_string 10)
- local passwordTemp=$(gen_random_string 10)
local portTemp=$(shuf -i 1024-62000 -n 1)
- /usr/local/x-ui/x-ui setting -username "${usernameTemp}" -password "${passwordTemp}" -port "${portTemp}" -webBasePath "${config_webBasePath}"
+ /usr/local/x-ui/x-ui setting -username "${config_account}" -password "${config_password}" -port "${portTemp}" -webBasePath "${config_webBasePath}"
echo -e "This is a fresh installation, generating random login info for security concerns:"
echo -e "###############################################"
- echo -e "${green}Username: ${usernameTemp}${plain}"
- echo -e "${green}Password: ${passwordTemp}${plain}"
+ echo -e "${green}Username: ${config_account}${plain}"
+ echo -e "${green}Password: ${config_password}${plain}"
echo -e "${green}Port: ${portTemp}${plain}"
echo -e "${green}WebBasePath: ${config_webBasePath}${plain}"
echo -e "###############################################"
@@ -195,7 +191,7 @@ config_after_install() {
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}"
+ echo -e "${green}New WebBasePath: ${config_webBasePath}${plain}"
fi
fi
fi