|
@@ -142,6 +142,8 @@ config_after_install() {
|
|
local existing_username=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'username: .+' | awk '{print $2}')
|
|
local existing_username=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'username: .+' | awk '{print $2}')
|
|
local existing_password=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'password: .+' | awk '{print $2}')
|
|
local existing_password=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'password: .+' | awk '{print $2}')
|
|
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
|
|
local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
|
|
|
|
+ local existing_port=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'port: .+' | awk '{print $2}')
|
|
|
|
+ local server_ip=$(curl -s https://api.ipify.org)
|
|
|
|
|
|
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
|
if [[ ${#existing_webBasePath} -lt 4 ]]; then
|
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|
|
@@ -149,7 +151,7 @@ config_after_install() {
|
|
local config_username=$(gen_random_string 10)
|
|
local config_username=$(gen_random_string 10)
|
|
local config_password=$(gen_random_string 10)
|
|
local config_password=$(gen_random_string 10)
|
|
|
|
|
|
- read -p "Would you like to customize the Panel Port settings? (If not, random port will be applied) [y/n]: " config_confirm
|
|
|
|
|
|
+ read -p "Would you like to customize the Panel Port settings? (If not, a random port will be applied) [y/n]: " config_confirm
|
|
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
|
|
if [[ "${config_confirm}" == "y" || "${config_confirm}" == "Y" ]]; then
|
|
read -p "Please set up the panel port: " config_port
|
|
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}"
|
|
@@ -165,6 +167,7 @@ config_after_install() {
|
|
echo -e "${green}Password: ${config_password}${plain}"
|
|
echo -e "${green}Password: ${config_password}${plain}"
|
|
echo -e "${green}Port: ${config_port}${plain}"
|
|
echo -e "${green}Port: ${config_port}${plain}"
|
|
echo -e "${green}WebBasePath: ${config_webBasePath}${plain}"
|
|
echo -e "${green}WebBasePath: ${config_webBasePath}${plain}"
|
|
|
|
+ echo -e "${green}Access URL: http://${server_ip}:${config_port}${config_webBasePath}${plain}"
|
|
echo -e "###############################################"
|
|
echo -e "###############################################"
|
|
echo -e "${yellow}If you forgot your login info, you can type 'x-ui settings' to check${plain}"
|
|
echo -e "${yellow}If you forgot your login info, you can type 'x-ui settings' to check${plain}"
|
|
else
|
|
else
|
|
@@ -172,6 +175,7 @@ config_after_install() {
|
|
echo -e "${yellow}WebBasePath is missing or too short. Generating a new one...${plain}"
|
|
echo -e "${yellow}WebBasePath is missing or too short. Generating a new one...${plain}"
|
|
/usr/local/x-ui/x-ui setting -webBasePath "${config_webBasePath}"
|
|
/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}"
|
|
|
|
+ echo -e "${green}Access URL: http://${server_ip}:${existing_port}${config_webBasePath}${plain}"
|
|
fi
|
|
fi
|
|
else
|
|
else
|
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|
|
if [[ "$existing_username" == "admin" && "$existing_password" == "admin" ]]; then
|