summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-31 17:30:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-31 17:30:43 +0100
commitefa0a06abf2c3d493b50ad6793ae780b956e1739 (patch)
tree6c1d9f2cdfb8fc4362f99c5a1b4052f8d5b7f443
parentcfae954cb64cefb12cf340ad72e0bc391365ffef (diff)
downloadbin-efa0a06abf2c3d493b50ad6793ae780b956e1739.zip
bin-efa0a06abf2c3d493b50ad6793ae780b956e1739.tar.gz
add wakey
-rwxr-xr-xwakey13
1 files changed, 13 insertions, 0 deletions
diff --git a/wakey b/wakey
new file mode 100755
index 0000000..1c6473e
--- /dev/null
+++ b/wakey
@@ -0,0 +1,13 @@
+#! /bin/bash
+[ $# -lt 2 ] && echo "missing mandatory arguments 'hostname' 'mac'" && exit 1
+host=$1
+mac=$2
+CPT=0
+while [ ${CPT} -ne 5 ]; do
+ CPT=$((CPT+1))
+ wol $mac
+ ping -c 1 -W 10 $host 2>&1 >/dev/null
+ [ $? -eq 0 ] && break
+done
+[ $? -ne 0 ] && echo " he is still asleep !" && exit 1
+echo "$host is up, have fun!"