bin/radstart
b528647b
 #!/bin/bash
 #
f7a9cacf
 # The monitor url can look something like http://192.168.1.155, or
 # something linke http://radiationMonitor.domain.com depending on
 # whether your local network uses a domain name server.
 #
db8a5c09
 
 APP_PATH="/home/$USER/bin"
 LOG_PATH="/home/$USER/log"
b528647b
 
e7812e8c
 AGENT_NAME="[r]admonAgent.py"
 SOURCE_URL="{your radiation monitor url}"
 
 PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')"
66d7b126
 
b528647b
 if [ -n "$PROCESS_ID" ]; then
66d7b126
   if [ "$1" != "-q" ]; then
     printf "radmon agent running [%s]\n" $PROCESS_ID
   fi
b528647b
 else
66d7b126
   printf "starting up radmon agent\n"
   cd $APP_PATH
e7812e8c
   if [ "$1" != "" ]; then
     ./$AGENT_NAME $1 -u $SOURCE_URL
   else
     ./$AGENT_NAME -u $SOURCE_URL >> \
       $LOG_PATH/radmonAgent.log 2>&1 &
   fi
b528647b
 fi