File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # wrapper script to execute commands from stdin
3+ # invoked by o2-readout-exe
4+ # if launched without argument, read commands from stdin line by line
5+
6+ # ensure log output not going to stdout
7+ unset O2_INFOLOGGER_MODE
8+
9+ LOG=" /opt/o2-InfoLogger/bin/o2-infologger-log -oFacility=readout -oLevel=11 -oErrorCode=3013"
10+ CMD=" '$* '"
11+
12+ if [ " $1 " == " " ]; then
13+
14+ $LOG " Starting command launcher"
15+ while read line
16+ do
17+ $LOG " Executing command $line "
18+ eval $line 2>&1 | $LOG -x -oSeverity=Debug
19+
20+ if [ 0 -eq ${PIPESTATUS[0]} ]; then
21+ echo " ok"
22+ $LOG " Command ok"
23+ else
24+ echo " error"
25+ $LOG -oSeverity=Error " Command error"
26+ fi
27+ done
28+ $LOG " Exiting command launcher"
29+ exit 0
30+
31+ else
32+
33+ $LOG " Executing command $CMD "
34+ $@ 2>&1 | $LOG -x -oSeverity=Debug
35+
36+ if [ 0 -eq ${PIPESTATUS[0]} ]; then
37+ echo " ok"
38+ $LOG " Command ok"
39+ exit 0
40+ else
41+ echo " error"
42+ $LOG -oSeverity=Error " Command error"
43+ exit 1
44+ fi
45+
46+ fi
47+
You can’t perform that action at this time.
0 commit comments