projects
/
scripts
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e692ea
)
added wakeup.sh script
author
hackbard
<hackbard>
Thu, 6 Jan 2005 20:44:44 +0000
(20:44 +0000)
committer
hackbard
<hackbard>
Thu, 6 Jan 2005 20:44:44 +0000
(20:44 +0000)
README
patch
|
blob
|
history
wakeup.sh
[new file with mode: 0755]
patch
|
blob
diff --git
a/README
b/README
index
01eb0dd
..
80a2c79
100644
(file)
--- a/
README
+++ b/
README
@@
-21,4
+21,7
@@
- backup_win.sh
small script to do backups from a windows machine via smbfs (for maik)
- backup_win.sh
small script to do backups from a windows machine via smbfs (for maik)
+- wakeup.sh
+ wake up hosts by hostname using etherwake & /etc/ethers file
+
EOF
EOF
diff --git a/wakeup.sh
b/wakeup.sh
new file mode 100755
(executable)
index 0000000..
9476a9c
--- /dev/null
+++ b/
wakeup.sh
@@ -0,0
+1,19
@@
+#!/bin/bash
+
+# wake up specified host (parse /etc/ethers)
+
+if [ -z $1 ] ; then
+ echo
+ echo "usage: $0 <hostname>"
+ echo
+ exit
+fi
+
+cat /etc/ethers | while read host mac; do
+ if [ "$1" = "$host" ] ; then
+ echo -n "waking up $host ($mac) ..."
+ etherwake $mac
+ echo " done"
+ fi
+done
+