aboutsummaryrefslogtreecommitdiff
path: root/psshd
diff options
context:
space:
mode:
Diffstat (limited to 'psshd')
-rwxr-xr-xpsshd10
1 files changed, 10 insertions, 0 deletions
diff --git a/psshd b/psshd
index d4be512..7b12449 100755
--- a/psshd
+++ b/psshd
@@ -20,6 +20,16 @@ autossh='/usr/lib/autossh/autossh'
# Path to start-stop-daemon binary
startstopdaemon='/sbin/start-stop-daemon'
+# Neither of those are likely to be in your PATH if you're a normal user, so we
+# hardcode the paths and test for their existence
+if [[ ! -x "$autossh" ]]; then
+ printf "Can't execute ${autossh}!" >&2
+ exit 1
+elif [[ ! -x "$startstopdaemon" ]]; then
+ printf "Can't execute ${startstopdaemon}!" >&2
+ exit 1
+fi
+
# Set up a PID dir
dir="${TMPDIR:-/tmp}/psshd-${UID}"
mkdir -p "$dir"