-
Notifications
You must be signed in to change notification settings - Fork 1
/
awaken
executable file
·39 lines (36 loc) · 969 Bytes
/
awaken
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Simple bash script to power on a computer on the local network using Wake-on-Lan.
# The ethernet hardware (MAC) address of each host is hard coded in this script.
wakeup () {
if [ -x /usr/bin/wol ]; then
/usr/bin/wol "$1"
elif [ -x /usr/bin/wakeonlan ]; then
/usr/bin/wakeonlan "$1"
else
echo "No known wake-on-lan client found."
return 1
fi
}
if [ $1 ]; then
# At least one argument supplied
case "$1" in
q6600)
echo "Awakening host \"$1\"..."
wakeup "00:1f:d0:26:74:91"
;;
avalon)
echo "Awakening host \"$1\"..."
wakeup "00:1c:25:76:fd:ce"
;;
riven)
echo "Awakening host \"$1\"..."
wakeup c8:60:00:cc:3e:d4
;;
*)
echo "Hostname \"$1\" not known."
exit 1
;;
esac
else
echo "Usage: $(basename $0) <hostname>"
fi