This is an automated email from the ASF dual-hosted git repository.
zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git
The following commit(s) were added to refs/heads/master by this push:
new d3c6226b [horus] Implementing script recognition reboot (#410)
d3c6226b is described below
commit d3c6226b491c6e5b32eb3050e1357d619ae72d55
Author: mfordjody <[email protected]>
AuthorDate: Tue Oct 1 12:52:46 2024 +0800
[horus] Implementing script recognition reboot (#410)
---
app/horus/core/horuser/script/restart.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/horus/core/horuser/script/restart.sh
b/app/horus/core/horuser/script/restart.sh
index d126fdbe..b4585969 100644
--- a/app/horus/core/horuser/script/restart.sh
+++ b/app/horus/core/horuser/script/restart.sh
@@ -19,7 +19,11 @@ host_computer=$1
host_name=$2
host_pass=$3
-if [ $# -lt 2 ]; then
- echo "ERROR:The expected value is parameter 2, but there is only 1 input
paramter."
+if [ $# -lt 3 ]; then
+ echo "ERROR: The expected value is parameter 3, but there are only $#: input
parameters."
exit 1
-fi
\ No newline at end of file
+fi
+
+for i in $host_computer; do
+ sshpass -p$host_pass ssh -o "StrictHostKeyChecking=no" $host_name@$i "echo
$host_pass | sudo -S reboot"
+done
\ No newline at end of file