aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ringtone
diff options
context:
space:
mode:
authorGravatar ath3 <ha05190@protonmail.com>2019-06-27 03:38:02 +0200
committerGravatar ath3 <ha05190@protonmail.com>2019-06-27 03:38:02 +0200
commite5cda5460452e44e824bf7480ddb6db8625f694d (patch)
tree92c1e4565e1a699fa9e7a1b15d9c4b24fb0f2073 /plugins/ringtone
parent1e683095773ce339e17025f92f2f5b9e19c769bf (diff)
downloadnnn-e5cda5460452e44e824bf7480ddb6db8625f694d.tar.gz
Small ringtone plugin fixes
Diffstat (limited to 'plugins/ringtone')
-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"