Revision 6,
836 bytes
checked in by ajaworski, 13 years ago
(diff) |
Added scripts from tile machine
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[6] | 1 | #!/bin/bash |
---|
| 2 | while getopts "hwa" optname |
---|
| 3 | do |
---|
| 4 | case "$optname" in |
---|
| 5 | "h") |
---|
| 6 | HOST=1 |
---|
| 7 | ;; |
---|
| 8 | "w") |
---|
| 9 | WALL=1 |
---|
| 10 | ;; |
---|
| 11 | "a") |
---|
| 12 | ALL=1 |
---|
| 13 | ;; |
---|
| 14 | "?") |
---|
| 15 | echo "Unrecognized option $OPTARG" |
---|
| 16 | exit |
---|
| 17 | ;; |
---|
| 18 | ":") |
---|
| 19 | echo "No argument value for option $OPTARG" |
---|
| 20 | exit |
---|
| 21 | ;; |
---|
| 22 | esac |
---|
| 23 | done |
---|
| 24 | |
---|
| 25 | if [ "$WALL" != "1" -a "$HOST" != "1" -a "$ALL" != "1" ]; then |
---|
| 26 | echo "Usage: reboot_wall [-h] [-w] [-a]. One option must be specified." |
---|
| 27 | echo -e "\t-h\trun on host" |
---|
| 28 | echo -e "\t-w\trun on wall" |
---|
| 29 | echo -e "\t-a\trun on host and wall" |
---|
| 30 | exit |
---|
| 31 | fi |
---|
| 32 | |
---|
| 33 | if [ "$WALL" == "1" -o "$ALL" == "1" ]; then |
---|
| 34 | for i in `cat ~/bin/tiles_list` |
---|
| 35 | do |
---|
| 36 | echo $i | grep "^#" > /dev/null 2> /dev/null |
---|
| 37 | if [ $? != "0" ] |
---|
| 38 | then |
---|
| 39 | ssh $i poweroff |
---|
| 40 | fi |
---|
| 41 | done |
---|
| 42 | fi |
---|
| 43 | |
---|
| 44 | if [ "$HOST" == "1" -o "$ALL" == "1" ]; then |
---|
| 45 | poweroff |
---|
| 46 | fi |
---|
| 47 | |
---|
| 48 | |
---|
Note: See
TracBrowser
for help on using the repository browser.