Search Results

Search: Posts Made By: Rojan Shakya
2,635
Posted By Rojan Shakya
How to exit shell script if remote login unsuccessful?
#!/bin/bash
for servers in `cat ~/servers`
do
rosh -l root -n $servers 'if [ -d /opt/ca ]
then
echo $HOSTNAME
else
exit 1
fi'
done

I have few servers in the for loop that is powered off,...
Showing results 1 to 1 of 1

 
All times are GMT -4. The time now is 05:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy