New function display_header, just for better looks.

This commit is contained in:
Louwrentius 2009-03-12 20:48:14 +00:00
parent c8f4a2caa0
commit 244cfce933

26
ppss.sh
View File

@ -451,6 +451,15 @@ do
esac esac
done done
display_header () {
log INFO "---------------------------------------------------------"
log INFO "$SCRIPT_NAME version $SCRIPT_VERSION"
log INDO "---------------------------------------------------------"
log INFO "Hostname: $HOSTNAME"
}
# Init all vars # Init all vars
init_vars () { init_vars () {
@ -458,11 +467,8 @@ init_vars () {
then then
rm $LOGFILE rm $LOGFILE
fi fi
log INFO "---------------------------------------------------------" display_header
log INFO "$SCRIPT_NAME version $SCRIPT_VERSION"
log INDO "---------------------------------------------------------"
log INFO "Hostname: $HOSTNAME"
if [ -z "$COMMAND" ] if [ -z "$COMMAND" ]
then then
@ -1223,7 +1229,7 @@ main () {
;; ;;
start ) start )
# This option only starts all nodes. # This option only starts all nodes.
display_header
if [ ! -e "$NODES_FILE" ] if [ ! -e "$NODES_FILE" ]
then then
log INFO "ERROR file $NODES with list of nodes does not exist." log INFO "ERROR file $NODES with list of nodes does not exist."
@ -1239,7 +1245,7 @@ main () {
exit 0 exit 0
;; ;;
config ) config )
display_header
log INFO "Generating configuration file $CONFIG" log INFO "Generating configuration file $CONFIG"
add_var_to_config PPSS_LOCAL_TMPDIR "$PPSS_LOCAL_TMPDIR" add_var_to_config PPSS_LOCAL_TMPDIR "$PPSS_LOCAL_TMPDIR"
add_var_to_config PPSS_LOCAL_OUTPUT "$PPSS_LOCAL_OUTPUT" add_var_to_config PPSS_LOCAL_OUTPUT "$PPSS_LOCAL_OUTPUT"
@ -1248,18 +1254,21 @@ main () {
;; ;;
stop ) stop )
display_header
log INFO "Stopping PPSS on all nodes." log INFO "Stopping PPSS on all nodes."
exec_cmd "touch $STOP_SIGNAL" exec_cmd "touch $STOP_SIGNAL"
cleanup cleanup
exit exit
;; ;;
pause ) pause )
display_header
log INFO "Pausing PPSS on all nodes." log INFO "Pausing PPSS on all nodes."
exec_cmd "touch $PAUSE_SIGNAL" exec_cmd "touch $PAUSE_SIGNAL"
cleanup cleanup
exit exit
;; ;;
continue ) continue )
display_header
if does_file_exist "$STOP_SIGNAL" if does_file_exist "$STOP_SIGNAL"
then then
log INFO "Continuing processing, please use $0 start to start PPSS on al nodes." log INFO "Continuing processing, please use $0 start to start PPSS on al nodes."
@ -1274,18 +1283,21 @@ main () {
exit exit
;; ;;
deploy ) deploy )
display_header
log INFO "Deploying PPSS on nodes." log INFO "Deploying PPSS on nodes."
deploy_ppss deploy_ppss
cleanup cleanup
exit 0 exit 0
;; ;;
status ) status )
display_header
show_status show_status
cleanup cleanup
exit 0 exit 0
# some show command # some show command
;; ;;
erase ) erase )
display_header
log INFO "Erasing PPSS from all nodes." log INFO "Erasing PPSS from all nodes."
erase_ppss erase_ppss
cleanup cleanup