| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,15 @@ |
| 0 |
+function wake() {
|
|
| 1 |
+ local config_file=~/.wakeonlan/$1 |
|
| 2 |
+ if [[ ! -f $config_file ]]; then |
|
| 3 |
+ echo "ERROR: There is no configuration file at \"$config_file\"." |
|
| 4 |
+ return |
|
| 5 |
+ fi |
|
| 6 |
+ |
|
| 7 |
+ which wakeonlan > /dev/null |
|
| 8 |
+ if [[ ! $? == 0 ]]; then |
|
| 9 |
+ echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" |
|
| 10 |
+ return |
|
| 11 |
+ fi |
|
| 12 |
+ |
|
| 13 |
+ wakeonlan -f $config_file |
|
| 14 |
+} |