Skip to content

Commit

Permalink
[horus] Implementing script recognition reboot (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody authored Oct 1, 2024
1 parent 4e81fbe commit d3c6226
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/horus/core/horuser/script/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ host_computer=$1
host_name=$2
host_pass=$3

if [ $# -lt 2 ]; then
echo "ERRORThe 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
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

0 comments on commit d3c6226

Please sign in to comment.