diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-07 18:57:42 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-07 18:57:42 +1200 |
commit | cb91cd1d6fdb851d322885f6a66c76e2e6ed6262 (patch) | |
tree | 406515f868ef5bfa5f315ce435ad33e49b49245a | |
parent | Use printf rather than echo (diff) | |
download | psshd-cb91cd1d6fdb851d322885f6a66c76e2e6ed6262.tar.gz psshd-cb91cd1d6fdb851d322885f6a66c76e2e6ed6262.zip |
Move dir creation to beneath option parsing
-rwxr-xr-x | psshd | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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" |