]> git.madduck.net Git - code/molly-guard.git/blobdiff - shutdown

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

* Prevent set -u from falling over unset SSH_CONNECTION variable
[code/molly-guard.git] / shutdown
index 29bd8fe607102b41839c1ba30f78fc3d7e1c6d7e..0c52d92803e65b8e7615b918e9910e7ea55102b6 100755 (executable)
--- a/shutdown
+++ b/shutdown
@@ -91,7 +91,7 @@ test -t 0                    || do_real_cmd
 # was created by sshd.
 PTS=$(readlink /proc/$$/fd/0)
 if ! pgrep -f "^sshd.+${PTS#/dev/}[[:space:]]*$" >/dev/null \
 # was created by sshd.
 PTS=$(readlink /proc/$$/fd/0)
 if ! pgrep -f "^sshd.+${PTS#/dev/}[[:space:]]*$" >/dev/null \
-  && [ -z "$SSH_CONNECTION" ]; then
+  && [ -z "${SSH_CONNECTION:-}" ]; then
     if [ $PRETEND_SSH -eq 1 ]; then
       echo "I: this is not an SSH session, but --pretend-ssh was given..."
     else
     if [ $PRETEND_SSH -eq 1 ]; then
       echo "I: this is not an SSH session, but --pretend-ssh was given..."
     else