From 39fb0e30ac27de1ce7c3c03aacdf025c41a1afa7 Mon Sep 17 00:00:00 2001 From: Intel44 Date: Tue, 11 Jun 2024 21:46:57 +0200 Subject: [PATCH] fix: handle telnet response during stop process --- lgsm/modules/command_stop.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 29926f53a..8a9c6cb84 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -268,12 +268,16 @@ fn_stop_graceful_sm_telnet() { } spawn telnet '"${telnetip}"' '"${telnetport}"' expect { - "session." { send "saveworld 1\r" } - default abort + "Hello:" { send "saveworld 1\r" } + default abort } expect { - "session." { send "quit 1\r" } - default abort + "the world is saved." { send "quit 1\r" } + default abort + } + expect { + "World is closing..." {} + default abort } expect { eof } puts "Completed.\n"