made logs better

This commit is contained in:
Gordon Grant-Stuart 2023-05-25 13:06:00 +01:00
parent db89bc9bca
commit 2b825f0292

View File

@ -9,7 +9,7 @@ WATCHCONF="$BASEDIR/var/watch.conf"
DEBUGCONF="$BASEDIR/var/debug.conf" DEBUGCONF="$BASEDIR/var/debug.conf"
function genconfig () { function genconfig () {
mkdir -p "$BASEDIR/var" mkdir -p "$BASEDIR/var/log"
cat <<EOF > "$SSHCONF" cat <<EOF > "$SSHCONF"
Host * Host *
ExitOnForwardFailure yes ExitOnForwardFailure yes
@ -42,9 +42,9 @@ function debugopt () {
} }
function dbg () { function dbg () {
while read line; do if [[ "$(awk "/^$1/ {print \$2}" ${DEBUGCONF})" =~ "[123]" ]]; then
[[ "$(awk "/^$1/ {print \$2}" ${DEBUGCONF})" =~ "[123]" ]] && echo $line >> "$BASEDIR/var/tunnelkeeper-$(date +"%Y%m%d").log" cat | sed "s/^/$(date +"%H:%M:%S") /g" >> "$BASEDIR/var/log/tunnelkeeper-$(date +"%Y%m%d").log"
done fi
} }
function connect () { function connect () {