aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:57:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:57:42 +1200
commitcb91cd1d6fdb851d322885f6a66c76e2e6ed6262 (patch)
tree406515f868ef5bfa5f315ce435ad33e49b49245a
parentUse printf rather than echo (diff)
downloadpsshd-cb91cd1d6fdb851d322885f6a66c76e2e6ed6262.tar.gz
psshd-cb91cd1d6fdb851d322885f6a66c76e2e6ed6262.zip
Move dir creation to beneath option parsing
-rwxr-xr-xpsshd8
1 files changed, 4 insertions, 4 deletions
diff --git a/psshd b/psshd
index aefa4b1..fc8e868 100755
--- a/psshd
+++ b/psshd
@@ -30,10 +30,6 @@ elif [[ ! -x "$startstopdaemon" ]]; then
exit 1
fi
-# Set up a PID dir
-dir="${TMPDIR:-/tmp}/psshd-${UID}"
-mkdir -p "$dir"
-
# Get port in options
while getopts ':p:' opt
do
@@ -60,6 +56,10 @@ then
exit 1
fi
+# Set up a PID dir
+dir="${TMPDIR:-/tmp}/psshd-${UID}"
+mkdir -p "$dir"
+
# Export the two settings autossh absolutely needs
AUTOSSH_PIDFILE="${dir}/psshd-port-${port}.pid"
AUTOSSH_PORT="$port"