Skip to content

Instantly share code, notes, and snippets.

@ahonor
Created November 24, 2014 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahonor/637a479995761b0b5f69 to your computer and use it in GitHub Desktop.
Save ahonor/637a479995761b0b5f69 to your computer and use it in GitHub Desktop.
rerun module DSL
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