diff options
author | Sughosh Ganu <sughosh.ganu@arm.com> | 2018-12-26 20:50:06 +0530 |
---|---|---|
committer | Thomas Abraham <thomas.abraham@arm.com> | 2018-12-27 16:04:39 +0530 |
commit | c69667b70d0741a2e19f7b52a07aef5390de8df8 (patch) | |
tree | ef639bd03be1d30d4995d630676ee5cf6b95dcd0 | |
parent | 6e2f0815d048abb70b961d9921218305601ea637 (diff) |
sgi/common: add 'send_shutdown' function to shutdown the distro
Add a common function 'send_shutdown' that allows test scripts
to initiate the shutdown of the distribution executing on the
model.
Change-Id: I3c1027dff1b13bf464bcaec04b75e89c6c94ce79
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
-rw-r--r-- | sgi/sgi_common_util.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sgi/sgi_common_util.sh b/sgi/sgi_common_util.sh index 2a8e23e..2c24ef2 100644 --- a/sgi/sgi_common_util.sh +++ b/sgi/sgi_common_util.sh @@ -161,3 +161,19 @@ get_ip_addr_fedora () { eval "$1=$_IP" return 0 } + +## +# send shutdown signal to the os +## +send_shutdown () { + RET=1 + + echo -e "\n[INFO] Sending Shutdown Signal ...\n" + ssh -o ServerAliveInterval=30 \ + -o ServerAliveCountMax=720 \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null root@$2 \ + 'shutdown -h now' 2>&1 | tee -a $1 + RET=$? + return $RET +} |