Skip to content
Snippets Groups Projects
Verified Commit f699dbac authored by Clayton Craft's avatar Clayton Craft :speech_balloon:
Browse files

Support logging to stdout for running under systemd

If bootmac is running under systemd, sending output to `logger` usually
means that the output is not sent to journald, and is lost. This can
make debug more difficult. The var tested here is one that systemd sets
when running a daemon (see `man systemd.exec`.)
parent cc0d219b
Branches master
Tags v0.6.0
No related merge requests found
......@@ -19,8 +19,15 @@ MAC_PREFIX="0200"
BT_TIMEOUT=${BT_TIMEOUT:-5} # seconds
WLAN_TIMEOUT=${WLAN_TIMEOUT:-5} # seconds
USE_LOGGER=true
[ -n "$SYSTEMD_EXEC_PID" ] && USE_LOGGER=false
log() {
echo "$@" | logger -t "bootmac"
if "$USE_LOGGER"; then
echo "$@" | logger -t "bootmac"
else
echo "$@"
fi
}
help_info() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment