#!/bin/bash # Check if RT-STPS Server is running, and restart if it is not running. # LG 2012/10/11 # Log output log_file=$HOME/logs/rtstps_startup.log exec >> $log_file # Check for RT-STPS Server running in the background $HOME/rt-stps/jsw/bin/rt-stps-server.sh status &> /dev/null if [ $? -eq 0 ]; then exit 0 fi # Start RT-STPS Server echo echo "RT-STPS Server is not running at "$(date -u) $HOME/rt-stps/jsw/bin/rt-stps-server.sh restart if [ $? -eq 0 ]; then echo "Started RT-STPS Server" else echo "Failed to start RT-STPS Server" exit 1 fi # Pause for a few seconds for RT-STPS Server to finish startup sleep 5 # Configure RT-STPS for NPP $HOME/rt-stps/bin/load.sh $HOME/rt-stps/config/npp.xml if [ $? -eq 0 ]; then echo "Configured RT-STPS Server for NPP" else echo "Failed to configure RT-STPS Server for NPP" exit 1 fi exit 0