Browse Source

fix(stop): sdtd telnet stop will now work with no password set

pull/2150/head
Daniel Gibbs 6 years ago
parent
commit
43a69debd5
  1. 19
      lgsm/functions/command_stop.sh

19
lgsm/functions/command_stop.sh

@ -87,9 +87,21 @@ fn_stop_graceful_goldsource(){
# Attempts graceful of 7 Days To Die using telnet.
fn_stop_telnet_sdtd(){
if [ -z "${telnetpass}" ]; then
telnetpass="NOTSET"
fi
if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then
sdtd_telnet_shutdown=$( expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"session." { send "shutdown\r" }
default abort
}
expect { eof }
puts "Completed.\n"
')
else
sdtd_telnet_shutdown=$( expect -c '
proc abort {} {
puts "Timeout or EOF\n"
@ -107,6 +119,7 @@ fn_stop_telnet_sdtd(){
expect { eof }
puts "Completed.\n"
')
fi
}
fn_stop_graceful_sdtd(){

Loading…
Cancel
Save