diff options
-rwxr-xr-x | psshd | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -33,7 +33,7 @@ done while getopts ':p:' opt; do case $opt in p) - port="$OPTARG" + port=$OPTARG ;; \?) printf "Invalid option $OPTARG\n" >&2 @@ -54,15 +54,15 @@ if ! [[ "$port" ]]; then fi # Set up a PID dir -dir="${TMPDIR:-/tmp}/psshd-${UID}" +dir=${TMPDIR:-/tmp}/psshd-${UID} if ! mkdir -p "$dir"; then printf "Couldn't create directory ${dir} for PID file\n" >&2 exit 1 fi # Export the two settings autossh absolutely needs -AUTOSSH_PIDFILE="${dir}/psshd-port-${port}.pid" -AUTOSSH_PORT="$port" +AUTOSSH_PIDFILE=${dir}/psshd-port-${port}.pid +AUTOSSH_PORT=$port export AUTOSSH_PIDFILE AUTOSSH_PORT # Use start-stop-daemon to run it sanely |