mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-28 03:58:47 +00:00
Tweaks & EOL's added
This commit is contained in:
committed by
Ismo Vuorinen
parent
bb7ba3c919
commit
fa3dc531a0
@@ -22,7 +22,7 @@ if [ $# -lt 2 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $1 = "ssh" ]; then
|
||||
if [ "$1" = "ssh" ]; then
|
||||
HOST=$2
|
||||
else
|
||||
HOST=$1
|
||||
@@ -30,16 +30,17 @@ fi
|
||||
|
||||
echo "Waiting for $HOST to come online..."
|
||||
|
||||
ping -c 1 -W 1 $HOST > /dev/null
|
||||
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||
while [ $? -ne 0 ]; do
|
||||
sleep 1
|
||||
ping -c 1 -W 1 $HOST > /dev/null
|
||||
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||
done
|
||||
|
||||
# By the time we reach here the ping-command has completed successfully
|
||||
# so we can launch the command we were given - along with any arguments.
|
||||
if [ $1 != "ssh" ]; then
|
||||
if [ "$1" != "ssh" ]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
"$@"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user