aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:40:07 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-07 18:40:07 +1200
commit28c0e215ce805b4079e077e9e7572341b4f6729d (patch)
tree1c0232b8112cd5bc1bc340391760f9ce551b1206
parentDon't use errexit (diff)
downloadpsshd-28c0e215ce805b4079e077e9e7572341b4f6729d.tar.gz
psshd-28c0e215ce805b4079e077e9e7572341b4f6729d.zip
Use proper quoting
-rwxr-xr-xpsshd24
1 files changed, 12 insertions, 12 deletions
diff --git a/psshd b/psshd
index fd68d94..14b3345 100755
--- a/psshd
+++ b/psshd
@@ -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" \
-- "$@"