From efa0a06abf2c3d493b50ad6793ae780b956e1739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 31 Jan 2012 17:30:43 +0100 Subject: add wakey --- wakey | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 wakey 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!" -- cgit v1.1-2-g2b99