Test for required external commands
[trigger-rcmd.git] / scripts / trigger-rcmd
index 34f6f4d33f01a93aa0a5d9a4f5548d431d69fb14..17fd8a345b2973c75f2c073f13a1bac9ed52e71e 100755 (executable)
@@ -117,6 +117,15 @@ do_rcmd() {
 # Defaults
 NO_WAKE=
 
+# Check required tools
+for t in fping ssh etherwake; do
+       type "$t" >/dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               echo "$NAME: Required tool \"$t\" missing, aborting!"
+               exit 3
+       fi
+done
+
 while [ $# -gt 0 ]; do
        case "$1" in
          --no-wake|-n)