Skip to content

Commit

Permalink
fix incorrect s6wrap usage (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf authored May 6, 2024
1 parent f3df38a commit 0f0e420
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rootfs/etc/s6-overlay/scripts/fr24feed_check_traffic
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ while true; do
sleep "$WATCH_INTERVAL" &

if ! pcap_log=$(timeout --preserve-status "$WATCH_INTERVAL" tcpdump -p tcp src port "${BEASTPORT:-30005}" 2>/dev/stdout 1>/dev/null); then
"${s6wrap}" echo "[WARNING] Cannot check data flow because tcpdump fails to execute. Try adding NET_ADMIN and NET_RAW capabilities to your container"
"${s6wrap}" tail <<< "$pcap_log"
packets_rcvd="-1"
"${s6wrap[@]}" echo "[WARNING] Cannot check data flow because tcpdump fails to execute. Try adding NET_ADMIN and NET_RAW capabilities to your container"
"${s6wrap[@]}" tail <<< "$pcap_log"
packets_rcvd="-1"
else
packets_rcvd=$(sed -z 's/\n/; /g;s/; $//;s/^.*\s\([0-9]\+\) packets captured.*$/\1/g' <<< "$pcap_log")
fi
Expand All @@ -24,8 +24,8 @@ while true; do
tail -100 "${TRAFFIC_FILE}" > "${TRAFFIC_FILE}".1
mv -f "${TRAFFIC_FILE}".1 "${TRAFFIC_FILE}"
if chk_enabled "$VERBOSE_LOGGING" && [[ "$packets_rcvd" != "-1" ]]; then
s6wrap --quiet --timestamps --prepend="$(basename "$0")" --args echo "$packets_rcvd packets received from $BEASTHOST in the past 5 minutes"
fi
"${s6wrap[@]}" echo "$packets_rcvd packets received from $BEASTHOST in the past 5 minutes"
fi

wait
done

0 comments on commit 0f0e420

Please sign in to comment.