|
@ -3,7 +3,7 @@ |
|
|
# Author: Daniel Gibbs |
|
|
# Author: Daniel Gibbs |
|
|
# Contributor : UltimateByte |
|
|
# Contributor : UltimateByte |
|
|
# Website: http://gameservermanagers.com |
|
|
# Website: http://gameservermanagers.com |
|
|
lgsm_version="050116" |
|
|
lgsm_version="070116" |
|
|
|
|
|
|
|
|
# Description: Changes TS3 serveradmin password |
|
|
# Description: Changes TS3 serveradmin password |
|
|
|
|
|
|
|
@ -12,43 +12,39 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn_serveradmin_password_prompt(){ |
|
|
fn_serveradmin_password_prompt(){ |
|
|
fn_printwarn "Initiating TS3 serveradmin password change" |
|
|
echo "" |
|
|
sleep 2 |
|
|
echo "${gamename} ServerAdmin Password Change" |
|
|
echo -en "\n" |
|
|
echo "============================" |
|
|
echo "Changing telnet ServerQuery password" |
|
|
echo "" |
|
|
|
|
|
echo "Press \"CTRL+b d\" to exit console." |
|
|
|
|
|
fn_printwarningnl "You are about to change the ${gamename} ServerAdmin password" |
|
|
|
|
|
echo "" |
|
|
while true; do |
|
|
while true; do |
|
|
read -p "Continue ? [y/n]" yn |
|
|
read -e -i "y" -p "Continue? [y/N]" yn |
|
|
case $yn in |
|
|
case $yn in |
|
|
[Yy]* ) break;; |
|
|
[Yy]* ) break;; |
|
|
[Nn]* ) exit;; |
|
|
[Nn]* ) echo Exiting; return;; |
|
|
* ) echo "Please answer yes or no.";; |
|
|
* ) echo "Please answer yes or no.";; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
|
|
|
|
fn_scriptlog "Initiating ${gamename} ServerAdmin password change" |
|
|
fn_scriptlog "Initiating serveradmin password change" |
|
|
read -p "Enter new password : " newpassword |
|
|
echo -n "Enter the new password : " ; read newpassword |
|
|
|
|
|
fn_scriptlog "New serveradmin password chosen" |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn_serveradmin_password_set(){ |
|
|
fn_serveradmin_password_set(){ |
|
|
fn_printdots "Applying new password" |
|
|
fn_printinfo "Applying new password" |
|
|
|
|
|
fn_scriptlog "Applying new password" |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
fn_scriptlog "Starting routine with new password start option" |
|
|
# Stop any running server |
|
|
|
|
|
command_stop.sh |
|
|
./ts3server_startscript.sh start serveradmin_password="${newpassword}" > /dev/null 2>&1 |
|
|
# Start server in "new password mode" |
|
|
|
|
|
ts3serverpass="1" |
|
|
info_ts3status.sh |
|
|
command_start.sh |
|
|
if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
|
# Stop server in "new password mode" |
|
|
fn_printfailnl "Unable to start ${servername}" |
|
|
command_stop.sh |
|
|
fn_scriptlog "Unable to start ${servername}" |
|
|
fn_printok "Applying new password" |
|
|
echo -e " Check log files: ${rootdir}/log" |
|
|
fn_scriptlog "New ServerAdmin password has been applyed" |
|
|
exit 1 |
|
|
|
|
|
else |
|
|
|
|
|
fn_printok "${servername} has set a new serveradmin password" |
|
|
|
|
|
echo -en "\n" |
|
|
|
|
|
fn_scriptlog "Started ${servername} with new password" |
|
|
|
|
|
fi |
|
|
|
|
|
sleep 1 |
|
|
sleep 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -58,14 +54,8 @@ fn_serveradmin_password_prompt |
|
|
info_ts3status.sh |
|
|
info_ts3status.sh |
|
|
|
|
|
|
|
|
if [ "${ts3status}" == "Server is running" ]; then |
|
|
if [ "${ts3status}" == "Server is running" ]; then |
|
|
command_stop.sh |
|
|
|
|
|
fn_serveradmin_password_set |
|
|
fn_serveradmin_password_set |
|
|
echo "Server will now restart normally" |
|
|
|
|
|
sleep 1 |
|
|
|
|
|
command_stop.sh |
|
|
|
|
|
command_start.sh |
|
|
command_start.sh |
|
|
else |
|
|
else |
|
|
fn_serveradmin_password_set |
|
|
fn_serveradmin_password_set |
|
|
echo -en "\n" |
|
|
|
|
|
command_stop.sh |
|
|
|
|
|
fi |
|
|
fi |