From 1cca9e4b72b106374f203890b266f18609deefe3 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 22 Nov 2019 02:14:25 +0530 Subject: shellcheck fixes --- plugins/ringtone | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/ringtone') diff --git a/plugins/ringtone b/plugins/ringtone index d67a409..38c11bd 100755 --- a/plugins/ringtone +++ b/plugins/ringtone @@ -13,20 +13,21 @@ # Author: Arun Prakash Jana if [ -n "$1" ]; then - echo -n "start (hh:mm:ss): " - read start + printf "start (hh:mm:ss): " + read -r start st=$(date -d "$start" +%s) || exit 1 - echo -n "end (hh:mm:ss): " - read end + printf "end (hh:mm:ss): " + read -r end et=$(date -d "$end" +%s) || exit 1 - if [ $st -ge $et ]; then - echo "error: start >= end" + if [ "$st" -ge "$et" ]; then + printf "error: start >= end " + read -r _ exit 1 fi - interval=$(( $et - $st )) + interval=$(( et - st )) outfile=$(basename "$1") outfile="${outfile%.*}"_ringtone.mp3 -- cgit v1.2.3-70-g09d2