|
@@ -5,13 +5,12 @@
|
|
|
# Website: https://linuxgsm.com
|
|
# Website: https://linuxgsm.com
|
|
|
# Description: Changes TS3 serveradmin password.
|
|
# Description: Changes TS3 serveradmin password.
|
|
|
|
|
|
|
|
-local commandname="TS3-CHANGE-PASS"
|
|
|
|
|
-local commandaction="ServerAdmin Password Change"
|
|
|
|
|
|
|
+local commandname="PASSWORD-CHANGE"
|
|
|
|
|
+local commandaction="Password Change"
|
|
|
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
|
|
|
|
|
fn_serveradmin_password_prompt(){
|
|
fn_serveradmin_password_prompt(){
|
|
|
fn_print_header
|
|
fn_print_header
|
|
|
- echo -e "Press \"CTRL+b d\" to exit console."
|
|
|
|
|
fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password."
|
|
fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password."
|
|
|
fn_print_warning_nl "${gamename} will restart during this process."
|
|
fn_print_warning_nl "${gamename} will restart during this process."
|
|
|
echo -e ""
|
|
echo -e ""
|
|
@@ -19,32 +18,30 @@ fn_serveradmin_password_prompt(){
|
|
|
echo Exiting; exit
|
|
echo Exiting; exit
|
|
|
fi
|
|
fi
|
|
|
fn_script_log_info "Initiating ${gamename} ServerAdmin password change"
|
|
fn_script_log_info "Initiating ${gamename} ServerAdmin password change"
|
|
|
- read -rp "Enter new password : " newpassword
|
|
|
|
|
|
|
+ read -rp "Enter new password: " newpassword
|
|
|
|
|
+ fn_print_info_nl "Changing password"
|
|
|
|
|
+ fn_script_log_info "Changing password"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fn_serveradmin_password_set(){
|
|
fn_serveradmin_password_set(){
|
|
|
- fn_print_info_nl "Starting server with new password..."
|
|
|
|
|
- fn_script_log_info "Starting server with new password"
|
|
|
|
|
# Start server in "new password mode".
|
|
# Start server in "new password mode".
|
|
|
ts3serverpass="1"
|
|
ts3serverpass="1"
|
|
|
exitbypass="1"
|
|
exitbypass="1"
|
|
|
command_start.sh
|
|
command_start.sh
|
|
|
- fn_print_ok_nl "Password applied"
|
|
|
|
|
|
|
+ fn_print_ok_nl "New password applied"
|
|
|
fn_script_log_pass "New ServerAdmin password applied"
|
|
fn_script_log_pass "New ServerAdmin password applied"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Running functions.
|
|
# Running functions.
|
|
|
check.sh
|
|
check.sh
|
|
|
fn_serveradmin_password_prompt
|
|
fn_serveradmin_password_prompt
|
|
|
-check_status.sh
|
|
|
|
|
if [ "${status}" != "0" ]; then
|
|
if [ "${status}" != "0" ]; then
|
|
|
# Stop any running server.
|
|
# Stop any running server.
|
|
|
exitbypass="1"
|
|
exitbypass="1"
|
|
|
command_stop.sh
|
|
command_stop.sh
|
|
|
fn_serveradmin_password_set
|
|
fn_serveradmin_password_set
|
|
|
|
|
+ parms="serveradmin_password=\"${newpassword}\" inifile=\"${servercfgfullpath}\" > /dev/null 2>&1"
|
|
|
ts3serverpass="0"
|
|
ts3serverpass="0"
|
|
|
- fn_print_info_nl "Restarting server normally"
|
|
|
|
|
- fn_script_log_info "Restarting server normally"
|
|
|
|
|
command_restart.sh
|
|
command_restart.sh
|
|
|
else
|
|
else
|
|
|
fn_serveradmin_password_set
|
|
fn_serveradmin_password_set
|