Browse Source

Merge pull request #2 from kuzukami/stdout_journald_logging_for_systemd

Stdout journald logging for systemd
master
Gerhard 1 year ago
committed by GitHub
parent
commit
b4bea73c91
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      ssh-tunnel-manager.conf.example
  2. 7
      ssh-tunnel-manager.sh

1
ssh-tunnel-manager.conf.example

@ -43,6 +43,7 @@ RECONNECT_TIMER=5
# as the script directory.
#
LOGFILE="/var/log/ssh-tunnel-manager.log"
#LOGFILE="" #stdout to journald for systemd-system
#
# This DBG setting is adding additional details to the logfile. The values are 0

7
ssh-tunnel-manager.sh

@ -228,7 +228,12 @@ fi
function echotime
{
TIME=`date "+[%Y-%m-%d %H:%M:%S]"`
echo -e "$TIME - $@" >>$LOGFILE
if [ -z "$LOGFILE" ]; then
#stdout for non-privileged user on systemd
echo -e "$TIME - $@"
else
echo -e "$TIME - $@" >>$LOGFILE
fi
}
#

Loading…
Cancel
Save