source: trunk/scripts/rebootwall @ 5

Revision 5, 832 bytes checked in by ajaworski, 13 years ago (diff)

Added config files and operation scripts

  • Property svn:executable set to *
Line 
1#!/bin/bash
2while 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
25if [ "$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
31fi
32
33if [ "$WALL" == "1" -o "$ALL" == "1" ]; then
34for i in `cat ~/bin/tiles_list`
35do
36        echo $i | grep "^#" > /dev/null 2> /dev/null
37        if [ $? != "0" ]
38        then
39                ssh $i reboot
40        fi
41done
42fi
43
44if [ "$HOST" == "1" -o "$ALL" == "1" ]; then
45        reboot
46fi
47
48
Note: See TracBrowser for help on using the repository browser.