This commit is contained in:
Louwrentius 2009-02-28 18:42:16 +00:00
parent 32ca4f4b49
commit d57cced06a
1 changed files with 81 additions and 36 deletions

View File

@ -250,7 +250,7 @@ while [ $# -gt 0 ]
do do
case $1 in case $1 in
-config ) -config )
CONFIG=$2 CONFIG="$2"
if [ "$MODE" == "config" ] if [ "$MODE" == "config" ]
then then
@ -507,6 +507,21 @@ check_status () {
} }
erase_ppss () {
echo "Are you realy sure you want to erase PPSS from all nades!?"
read YN
if [ "$YN" == "y" ]
then
for x in `cat $NODES_FILE`
do
log INFO "Erasing PPSS from node $x."
exec_cmd "rm -rf $PPSS_HOME_DIR"
done
fi
}
deploy_ppss () { deploy_ppss () {
ERROR=0 ERROR=0
@ -1018,6 +1033,29 @@ start_all_workers () {
done done
} }
show_status () {
source $CONFIG
if [ ! -z "$SSH_KEY" ]
then
SSH_KEY="-i $SSH_KEY"
fi
if [ -z "$INPUT_FILE" ]
then
ITEMS=`exec_cmd "ls -1 $SRC_DIR | wc -l"`
else
ITEMS=`exec_cmd "cat $INPUT_FILE | wc -l"`
fi
PROCESSED=`exec_cmd "ls -1 $ITEM_LOCK_DIR | wc -l"`
#STATUS=`echo "100 * $PROCESSED / $ITEMS" | bc`
STATUS=$((100 * $PROCESSED / $ITEMS))
echo "$STATUS percent complete."
}
# If this is called, the whole framework will execute. # If this is called, the whole framework will execute.
main () { main () {
@ -1056,7 +1094,7 @@ main () {
log INFO "Generating configuration file $CONFIG" log INFO "Generating configuration file $CONFIG"
cleanup cleanup
exit exit 0
;; ;;
stop ) stop )
@ -1064,10 +1102,17 @@ main () {
;; ;;
deploy ) deploy )
deploy_ppss deploy_ppss
cleanup
exit 0
;; ;;
show ) status )
show_status
# some show command # some show command
;; ;;
erase )
erase_ppss
cleanup
exit 0
* ) * )
showusage showusage
exit 1;; exit 1;;