Daniel Gibbs 1 rok temu
rodzic
commit
058f63d689
2 zmienionych plików z 7 dodań i 6 usunięć
  1. 4 4
      lgsm/modules/command_stop.sh
  2. 3 2
      lgsm/modules/install_config.sh

+ 4 - 4
lgsm/modules/command_stop.sh

@@ -20,7 +20,7 @@ fn_stop_graceful_ctrlc() {
 	for seconds in {1..30}; do
 	for seconds in {1..30}; do
 		check_status.sh
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 		if [ "${status}" == "0" ]; then
-			fn_print_ok "Graceful: CTRL+c: ${seconds}: "
+			fn_print_ok "Graceful: CTRL+c: ${seconds}"
 			fn_print_ok_eol_nl
 			fn_print_ok_eol_nl
 			fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds"
 			fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds"
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@@ -52,7 +52,7 @@ fn_stop_graceful_cmd() {
 	for ((seconds = 1; seconds <= ${2}; seconds++)); do
 	for ((seconds = 1; seconds <= ${2}; seconds++)); do
 		check_status.sh
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 		if [ "${status}" == "0" ]; then
-			fn_print_ok "Graceful: sending \"${1}\": ${seconds}: "
+			fn_print_ok "Graceful: sending \"${1}\": ${seconds}"
 			fn_print_ok_eol_nl
 			fn_print_ok_eol_nl
 			fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
 			fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@@ -85,7 +85,7 @@ fn_stop_graceful_goldsrc() {
 		fn_sleep_time_1
 		fn_sleep_time_1
 		fn_print_dots "Graceful: sending \"quit\": ${seconds}"
 		fn_print_dots "Graceful: sending \"quit\": ${seconds}"
 	done
 	done
-	fn_print_ok "Graceful: sending \"quit\": ${seconds}: "
+	fn_print_ok "Graceful: sending \"quit\": ${seconds}"
 	fn_print_ok_eol_nl
 	fn_print_ok_eol_nl
 	fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds"
 	fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds"
 	if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
 	if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@@ -297,7 +297,7 @@ fn_stop_graceful_avorion() {
 	for seconds in {1..30}; do
 	for seconds in {1..30}; do
 		check_status.sh
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 		if [ "${status}" == "0" ]; then
-			fn_print_ok "Graceful: /save /stop: ${seconds}: "
+			fn_print_ok "Graceful: /save /stop: ${seconds}"
 			fn_print_ok_eol_nl
 			fn_print_ok_eol_nl
 			fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds"
 			fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds"
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
 			if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then

+ 3 - 2
lgsm/modules/install_config.sh

@@ -109,14 +109,15 @@ fn_set_config_vars() {
 		else
 		else
 			changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}")
 			changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}")
 		fi
 		fi
-		echo -e "changing rcon/admin password."
+		echo -en "changing rcon/admin password."
 		fn_script_log_info "Changing rcon/admin password."
 		fn_script_log_info "Changing rcon/admin password."
 		if [ "${shortname}" == "squad" ]; then
 		if [ "${shortname}" == "squad" ]; then
 			changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg")
 			changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg")
 		else
 		else
 			changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}")
 			changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}")
 		fi
 		fi
-		if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
+		exitcode=$?
+		if [ "${exitcode}" -ne 0 ]; then # shellcheck disable=SC2181
 			fn_print_fail_eol
 			fn_print_fail_eol
 			fn_script_log_fail "generating rcon/admin password"
 			fn_script_log_fail "generating rcon/admin password"
 		elif [ "${changes}" != "" ]; then
 		elif [ "${changes}" != "" ]; then