X-Git-Url: https://git.madduck.net/code/molly-guard.git/blobdiff_plain/0501ba4e94c207083f6c4010815592ef87785855..9c7c8ab4858f69298ff9da3a080a61996564150b:/run.d/30-query-hostname diff --git a/run.d/30-query-hostname b/run.d/30-query-hostname index 634a4c9..d040603 100755 --- a/run.d/30-query-hostname +++ b/run.d/30-query-hostname @@ -27,7 +27,7 @@ case "${ALWAYS_QUERY_HOSTNAME:-0}" in # only run if we are being called over SSH, that is if the current terminal # was created by sshd. PTS=$(readlink /proc/$$/fd/0) - if ! pgrep -f "^sshd.+${PTS#/dev/}[[:space:]]*$" >/dev/null \ + if ! pgrep -f "^sshd.+${PTS#/dev/}\>" >/dev/null \ && [ -z "${SSH_CONNECTION:-}" ]; then if [ $PRETEND_SSH -eq 1 ]; then echo "I: $ME: this is not an SSH session, but --pretend-ssh was given..." >&2