aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mischievous Meerkat <engineerarun@gmail.com>2019-06-27 07:32:18 +0530
committerGravatar GitHub <noreply@github.com>2019-06-27 07:32:18 +0530
commit169b29029e39d1531e2455f48a2411dc7846a014 (patch)
tree92c1e4565e1a699fa9e7a1b15d9c4b24fb0f2073
parent1e683095773ce339e17025f92f2f5b9e19c769bf (diff)
parente5cda5460452e44e824bf7480ddb6db8625f694d (diff)
downloadnnn-169b29029e39d1531e2455f48a2411dc7846a014.tar.gz
Merge pull request #299 from ath3/ringtone-fixes
Small ringtone plugin fixes
-rwxr-xr-xplugins/ringtone8
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"