New script to manage servers
This commit is contained in:
parent
0001a46686
commit
7b2a4185c9
3 changed files with 75 additions and 35 deletions
26
commands/manage-server.sh
Normal file
26
commands/manage-server.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#! /bin/sh
|
||||
|
||||
cd $(dirname "$0")
|
||||
|
||||
SRV_LIST="moore noyce hamano cpp"
|
||||
|
||||
ACTIONS="start stop restart"
|
||||
|
||||
for ACT in $ACTIONS
|
||||
do
|
||||
if [ -n "$1" ] && [ "$1" == "$ACT" ]
|
||||
then
|
||||
ACTION="$ACT"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$ACTION" ]
|
||||
then
|
||||
echo "Usage: $0 [$ACTIONS]"
|
||||
fi
|
||||
|
||||
for SRV in $SRV_LIST
|
||||
do
|
||||
ssh root@$SRV ~/liblerdorf/process/launch.sh "$ACTION"
|
||||
done
|
Reference in a new issue