Change shebang, close when ffmpeg is not present
This commit is contained in:
parent
e81622fb1b
commit
9443697295
16
audiotrim.sh
16
audiotrim.sh
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/bash
|
||||||
# Trim an audio file given a startpoint and an endpoint
|
# Trim an audio file given a startpoint and an endpoint
|
||||||
|
# Dependencies: ffmpeg
|
||||||
|
|
||||||
printHelp() {
|
printHelp() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@ -16,20 +17,25 @@ while true; do
|
|||||||
printHelp
|
printHelp
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
-*)
|
|
||||||
printf '%s\n' "Unknown option: ${1}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
-*)
|
||||||
|
printf '%s\n' "Unknown option: ${1}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ ! -x '/usr/bin/ffmpeg' ]]; then
|
||||||
|
printf '%s\n' 'ffmpeg program is not installed'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
readonly infile="${1}"
|
readonly infile="${1}"
|
||||||
readonly starttime="${2}"
|
readonly starttime="${2}"
|
||||||
readonly stoptime="${3}"
|
readonly stoptime="${3}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user