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

51
ppss.sh
View File

@ -250,7 +250,7 @@ while [ $# -gt 0 ]
do
case $1 in
-config )
CONFIG=$2
CONFIG="$2"
if [ "$MODE" == "config" ]
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 () {
ERROR=0
@ -1018,6 +1033,29 @@ start_all_workers () {
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.
main () {
@ -1056,7 +1094,7 @@ main () {
log INFO "Generating configuration file $CONFIG"
cleanup
exit
exit 0
;;
stop )
@ -1064,10 +1102,17 @@ main () {
;;
deploy )
deploy_ppss
cleanup
exit 0
;;
show )
status )
show_status
# some show command
;;
erase )
erase_ppss
cleanup
exit 0
* )
showusage
exit 1;;