aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpsshd15
1 files changed, 7 insertions, 8 deletions
diff --git a/psshd b/psshd
index f8dcdc6..5d372c8 100755
--- a/psshd
+++ b/psshd
@@ -21,14 +21,13 @@ self=psshd
PATH=/usr/lib/autossh/autossh:/sbin:$PATH
# Check we have access to the required binaries
-if ! type -p autossh >/dev/null; then
- printf '%s - Could not find autossh in PATH\n' "$script" >&2
- exit 127
-fi
-if ! type -p start-stop-daemon >/dev/null; then
- printf '%s - Could not find start-stop-daemon in PATH\n' "$script" >&2
- exit 127
-fi
+cmds=(autossh start-stop-daemon)
+for cmd in "${cmds[@]}"; do
+ if ! type -p "$cmd" >/dev/null; then
+ printf '%s - Could not find %s in PATH\n' "$self" "$cmd" >&2
+ exit 127
+ fi
+done
# Get port in options
while getopts ':p:' opt