Browse code

minor revisions

Gandolf authored on 06/23/2021 01:42:11
Showing 1 changed files
... ...
@@ -16,7 +16,10 @@ if [ -n "$PROCESS_ID" ]; then
16 16
 else
17 17
   printf "starting up node agent\n"
18 18
   cd $APP_PATH
19
-  $(./$AGENT_NAME >> \
20
- $LOG_PATH/npwAgent.log 2>&1 &)
19
+  if [ "$1" != "" ]; then
20
+    ./$AGENT_NAME $1
21
+  else
22
+    ./$AGENT_NAME >> $LOG_PATH/npwAgent.log 2>&1 &
23
+  fi
21 24
 fi
22 25
 
Browse code

added class methods for configuring sensor; added exception catching for json formatting code

Gandolf authored on 06/20/2021 00:40:59
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 #!/bin/bash
2
-#
2
+# Starts up the node power agent as a background process
3
+# and redirects output to a log file.
3 4
 
4 5
 APP_PATH="/home/$USER/bin"
5 6
 LOG_PATH="/home/$USER/log"
Browse code

Initial release

Gandolf authored on 05/29/2021 20:13:39
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+#
3
+
4
+APP_PATH="/home/$USER/bin"
5
+LOG_PATH="/home/$USER/log"
6
+
7
+AGENT_NAME="[n]pwAgent.py"
8
+
9
+PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')"
10
+
11
+if [ -n "$PROCESS_ID" ]; then
12
+  if [ "$1" != "-q" ]; then
13
+    printf "node power agent running [%s]\n" $PROCESS_ID
14
+  fi
15
+else
16
+  printf "starting up node agent\n"
17
+  cd $APP_PATH
18
+  $(./$AGENT_NAME >> \
19
+ $LOG_PATH/npwAgent.log 2>&1 &)
20
+fi
21
+