-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwakeonlan.sh
executable file
·47 lines (44 loc) · 983 Bytes
/
wakeonlan.sh
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
39
40
41
42
43
44
45
46
47
#!/bin/bash
# definition of MAC addresses
sthir=54:bf:64:a1:4f:f8
sanganak=90:b1:1c:8e:15:56
macbook=48:d7:05:ce:a7:97
# macbook=32:00:10:65:a0:00
wol=wakeonlan
if [[ "$OSTYPE" == "linux-gnu" ]]; then
if type wol > /dev/null; then
wol="wol"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
wol="wakeonlan"
# elif [[ "$OSTYPE" == "cygwin" ]]; then
# # POSIX compatibility layer and Linux environment emulation for Windows
# elif [[ "$OSTYPE" == "msys" ]]; then
# # Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
# elif [[ "$OSTYPE" == "win32" ]]; then
# # I'm not sure this can happen.
# elif [[ "$OSTYPE" == "freebsd"* ]]; then
# # ...
# else
# Unknown.
fi
echo "Which PC to wake?"
echo "s) sthir"
echo "n) sanganak"
echo "m) macbook"
echo "q) quit"
read input1
case $input1 in
s)
eval $wol $sthir
;;
n)
eval $wol $sanganak
;;
m)
eval $wol $macbook
;;
Q|q)
break
;;
esac