Created
November 24, 2014 17:48
-
-
Save ahonor/637a479995761b0b5f69 to your computer and use it in GitHub Desktop.
rerun module DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name waitfor | |
description "waits for stuff" | |
requires othermodule | |
externals a b c | |
version 1.0.0 | |
command:ping() { | |
name ping | |
description "Ping the host" | |
option "--host <>" HOST | |
option "[--interval <30>]" INTERVAL | |
script() { | |
HOST=$(option --value HOST) | |
INTERVAL=$(option --value INTERVAL) | |
until ( ping -c 1 $HOST | grep -q ^64 ) | |
do | |
sleep $INTERVAL | |
echo Pinging $HOST... | |
done | |
echo "OK: $HOST is pingable." | |
} | |
script "$@" | |
} | |
archive() { | |
format "shar" | |
file "./waitfor" | |
version 1.0.0 | |
template "templates/mytemplate" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment