... | ... |
@@ -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 |
|
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 |
+ |