diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-07 18:40:07 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-07 18:40:07 +1200 |
commit | 28c0e215ce805b4079e077e9e7572341b4f6729d (patch) | |
tree | 1c0232b8112cd5bc1bc340391760f9ce551b1206 | |
parent | Don't use errexit (diff) | |
download | psshd-28c0e215ce805b4079e077e9e7572341b4f6729d.tar.gz psshd-28c0e215ce805b4079e077e9e7572341b4f6729d.zip |
Use proper quoting
-rwxr-xr-x | psshd | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -15,21 +15,21 @@ # # Path to autossh binary (not any wrapper script) -autossh=/usr/lib/autossh/autossh +autossh='/usr/lib/autossh/autossh' # Path to start-stop-daemon binary -startstopdaemon=/sbin/start-stop-daemon +startstopdaemon='/sbin/start-stop-daemon' # Set up a PID dir -dir=${TMPDIR:-/tmp}/psshd-${UID} -mkdir -p $dir +dir="${TMPDIR:-/tmp}/psshd-${UID}" +mkdir -p "$dir" # Get port in options while getopts ':p:' opt do - case $opt in + case "$opt" in p) - port=$OPTARG + port="$OPTARG" ;; \?) echo "Invalid option $OPTARG" >&2 @@ -41,7 +41,7 @@ do ;; esac done -shift $((OPTIND-1)) +shift "$((OPTIND-1))" # If no port, give up with usage instructions if [[ ! -n "$port" ]] @@ -51,14 +51,14 @@ then fi # Export the two settings autossh absolutely needs -export AUTOSSH_PORT=$port -export AUTOSSH_PIDFILE=${dir}/psshd-port-${port}.pid +export AUTOSSH_PORT="$port" +export AUTOSSH_PIDFILE="${dir}/psshd-port-${port}.pid" # Use start-stop-daemon to run it sanely -$startstopdaemon \ +"$startstopdaemon" \ --start \ --quiet \ - --pidfile $AUTOSSH_PIDFILE \ - --exec $autossh \ + --pidfile "$AUTOSSH_PIDFILE" \ + --exec "$autossh" \ -- "$@" |