Skip to content

Commit

Permalink
Add client script
Browse files Browse the repository at this point in the history
  • Loading branch information
thelazt committed Jul 7, 2022
1 parent d5b92a3 commit 0c2cd23
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions wake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

WAKEHOST=i4woke.informatik.uni-erlangen.de
WAKEPORT=8423
WAKETIME=5

echo "i4 Wake-On-LAN Client"
if [[ $# -eq 0 ]] ; then
echo "Usage $0 HOST [HOST...]" >&2
exit 1
else
for HOST in $@ ; do
if result=$(echo "${HOST}" | nc -w${WAKETIME} ${WAKEHOST} ${WAKEPORT} 2>/dev/null) ; then
printf " - %-20s [%s]\n" "${HOST}" "${result}"
else
echo "Connection to i4 Wake-On-LAN Server at ${WAKEHOST}:${WAKEPORT} failed - abort!"
exit 1
fi
done
fi

0 comments on commit 0c2cd23

Please sign in to comment.