diff options
author | ath3 <ha05190@protonmail.com> | 2019-06-27 03:38:02 +0200 |
---|---|---|
committer | ath3 <ha05190@protonmail.com> | 2019-06-27 03:38:02 +0200 |
commit | e5cda5460452e44e824bf7480ddb6db8625f694d (patch) | |
tree | 92c1e4565e1a699fa9e7a1b15d9c4b24fb0f2073 | |
parent | 1e683095773ce339e17025f92f2f5b9e19c769bf (diff) | |
download | nnn-e5cda5460452e44e824bf7480ddb6db8625f694d.tar.gz |
Small ringtone plugin fixes
-rwxr-xr-x | plugins/ringtone | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/ringtone b/plugins/ringtone index 3b16edd..ee7ae8a 100755 --- a/plugins/ringtone +++ b/plugins/ringtone @@ -8,14 +8,14 @@ # Shell: POSIX compliant # Author: Arun Prakash Jana -if ! [ -z "$1" ]; then +if [ -n "$1" ]; then echo -n "start (hh:mm:ss): " read start - st=`date -d "$start" +%s` + st=$(date -d "$start" +%s) || exit 1 echo -n "end (hh:mm:ss): " read end - et=`date -d "$end" +%s` + et=$(date -d "$end" +%s) || exit 1 if [ $st -ge $et ]; then echo "error: start >= end" @@ -24,7 +24,7 @@ if ! [ -z "$1" ]; then interval=$(( $et - $st )) - outfile=`basename "$1"` + outfile=$(basename "$1") outfile="${outfile%.*}"_ringtone.mp3 ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile" |