Change shebang, close when ffmpeg is not present

This commit is contained in:
Eric Torres 2018-12-15 21:23:44 -08:00
parent e81622fb1b
commit 9443697295

View File

@ -1,5 +1,6 @@
#!/bin/bash
#!/usr/bin/bash
# Trim an audio file given a startpoint and an endpoint
# Dependencies: ffmpeg
printHelp() {
cat << EOF
@ -16,20 +17,25 @@ while true; do
printHelp
exit
;;
-*)
printf '%s\n' "Unknown option: ${1}"
exit 1
;;
--)
shift
break
;;
-*)
printf '%s\n' "Unknown option: ${1}"
exit 1
;;
*)
break
;;
esac
done
if [[ ! -x '/usr/bin/ffmpeg' ]]; then
printf '%s\n' 'ffmpeg program is not installed'
exit 1
fi
readonly infile="${1}"
readonly starttime="${2}"
readonly stoptime="${3}"