Browse code

minor revision

Gandolf authored on 07/06/2021 21:30:56
Showing 1 changed files
... ...
@@ -4,12 +4,14 @@
4 4
 # something linke http://radiationMonitor.domain.com depending on
5 5
 # whether your local network uses a domain name server.
6 6
 #
7
-MONITOR_URL="{your monitor url}"
8 7
 
9 8
 APP_PATH="/home/$USER/bin"
10 9
 LOG_PATH="/home/$USER/log"
11 10
 
12
-PROCESS_ID="$(ps x | awk '/[r]admonAgent.py/{print $1}')"
11
+AGENT_NAME="[r]admonAgent.py"
12
+SOURCE_URL="{your radiation monitor url}"
13
+
14
+PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')"
13 15
 
14 16
 if [ -n "$PROCESS_ID" ]; then
15 17
   if [ "$1" != "-q" ]; then
... ...
@@ -18,5 +20,10 @@ if [ -n "$PROCESS_ID" ]; then
18 20
 else
19 21
   printf "starting up radmon agent\n"
20 22
   cd $APP_PATH
21
-  ./radmonAgent.py -t 10 -u $MONITOR_URL >> $LOG_PATH/radmonAgent.log 2>&1 &
23
+  if [ "$1" != "" ]; then
24
+    ./$AGENT_NAME $1 -u $SOURCE_URL
25
+  else
26
+    ./$AGENT_NAME -u $SOURCE_URL >> \
27
+      $LOG_PATH/radmonAgent.log 2>&1 &
28
+  fi
22 29
 fi
Browse code

minor revisions

Gandolf authored on 10/04/2020 05:03:10
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+#
3
+# The monitor url can look something like http://192.168.1.155, or
4
+# something linke http://radiationMonitor.domain.com depending on
5
+# whether your local network uses a domain name server.
6
+#
7
+MONITOR_URL="{your monitor url}"
8
+
9
+APP_PATH="/home/$USER/bin"
10
+LOG_PATH="/home/$USER/log"
11
+
12
+PROCESS_ID="$(ps x | awk '/[r]admonAgent.py/{print $1}')"
13
+
14
+if [ -n "$PROCESS_ID" ]; then
15
+  if [ "$1" != "-q" ]; then
16
+    printf "radmon agent running [%s]\n" $PROCESS_ID
17
+  fi
18
+else
19
+  printf "starting up radmon agent\n"
20
+  cd $APP_PATH
21
+  ./radmonAgent.py -t 10 -u $MONITOR_URL >> $LOG_PATH/radmonAgent.log 2>&1 &
22
+fi