Skip to content

Commit

Permalink
Merge pull request #1 from 76rhodan/master
Browse files Browse the repository at this point in the history
Added an env to disable the extractor
  • Loading branch information
rpatel3001 authored Apr 28, 2024
2 parents 951a3ce + 75f4c4c commit 32e4336
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- /dev:/dev:rw
- ./irdm.conf:/opt/irdm.conf:ro
environment:
# - DISABLE_EXTRACTOR=true
# - LOG_EXTRACTOR_STATS=true
# - LOG_MAP=true
# - EXTRACTOR_ARGS= -D 10
Expand Down
17 changes: 12 additions & 5 deletions rootfs/etc/s6-overlay/s6-rc.d/iridium-extractor/run
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/command/with-contenv bash
#shellcheck shell=bash

echo "Starting iridium-extractor and iridium-parser"

if [[ -n ${LOG_EXTRACTOR_STATS} ]]; then
python3 -u `which iridium-extractor` $EXTRACTOR_ARGS /opt/irdm.conf 2> >(stdbuf -o0 awk '{print "[iridium-extractor] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}') > >(pypy3 -u /opt/iridium-toolkit/iridium-parser.py $PARSER_ARGS -o zmq 2>&1 | stdbuf -o0 awk '{print "[iridium-parser] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}')
if [[ -n ${DISABLE_EXTRACTOR} ]]; then
echo "Not starting Extractor as it is disabled in the yml. You should know what you're doing."
sleep infinity
exit 0
else
python3 -u `which iridium-extractor` $EXTRACTOR_ARGS /opt/irdm.conf 2> >(stdbuf -o0 awk '{print "[iridium-extractor] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | grep WARNING) > >(pypy3 -u /opt/iridium-toolkit/iridium-parser.py $PARSER_ARGS -o zmq 2>&1 | stdbuf -o0 awk '{print "[iridium-parser] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}')

echo "Starting iridium-extractor and iridium-parser"

if [[ -n ${LOG_EXTRACTOR_STATS} ]]; then
python3 -u `which iridium-extractor` $EXTRACTOR_ARGS /opt/irdm.conf 2> >(stdbuf -o0 awk '{print "[iridium-extractor] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}') > >(pypy3 -u /opt/iridium-toolkit/iridium-parser.py $PARSER_ARGS -o zmq 2>&1 | stdbuf -o0 awk '{print "[iridium-parser] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}')
else
python3 -u `which iridium-extractor` $EXTRACTOR_ARGS /opt/irdm.conf 2> >(stdbuf -o0 awk '{print "[iridium-extractor] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}' | grep WARNING) > >(pypy3 -u /opt/iridium-toolkit/iridium-parser.py $PARSER_ARGS -o zmq 2>&1 | stdbuf -o0 awk '{print "[iridium-parser] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}')
fi
fi

0 comments on commit 32e4336

Please sign in to comment.