diff options
| author | 2019-11-22 02:14:25 +0530 | |
|---|---|---|
| committer | 2019-11-22 11:13:34 +0530 | |
| commit | 1cca9e4b72b106374f203890b266f18609deefe3 (patch) | |
| tree | 9f281f4b4de296c54d13dc9c7e214f58835636a7 /plugins/ringtone | |
| parent | ee2dcb1de7d3e82b330f49ee9fb5dfd4608207ff (diff) | |
| download | nnn-1cca9e4b72b106374f203890b266f18609deefe3.tar.gz | |
shellcheck fixes
Diffstat (limited to 'plugins/ringtone')
| -rwxr-xr-x | plugins/ringtone | 15 |
1 files changed, 8 insertions, 7 deletions
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 |