diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-03-06 16:03:13 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-03-06 16:03:13 +0100 |
commit | b6a0245796794228614c092c63b51bf50970fa08 (patch) | |
tree | fab95834d42c6330289fffe97fdb1b857f51ddca /contrib/eventcmd-examples/eventcmd.sh | |
parent | 7956d1a2f83bcb0d82da6af34a621709a21407cb (diff) | |
download | pianobar-b6a0245796794228614c092c63b51bf50970fa08.tar.gz pianobar-b6a0245796794228614c092c63b51bf50970fa08.tar.bz2 pianobar-b6a0245796794228614c092c63b51bf50970fa08.zip |
Avoid division by zero in eventcmd example script
Thanks to Richard.
Diffstat (limited to 'contrib/eventcmd-examples/eventcmd.sh')
-rwxr-xr-x | contrib/eventcmd-examples/eventcmd.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/eventcmd-examples/eventcmd.sh b/contrib/eventcmd-examples/eventcmd.sh index 32ffa00..2c0b159 100755 --- a/contrib/eventcmd-examples/eventcmd.sh +++ b/contrib/eventcmd-examples/eventcmd.sh @@ -25,7 +25,7 @@ case "$1" in # songfinish) # # scrobble if 75% of song have been played, but only if the song hasn't # # been banned -# if [ -n "$songDuration" ] && +# if [ -n "$songDuration" ] && [ "$songDuration" -ne 0 ] && # [ $(echo "scale=4; ($songPlayed/$songDuration*100)>50" | bc) -eq 1 ] && # [ "$rating" -ne 2 ]; then # # scrobbler-helper is part of the Audio::Scrobble package at cpan |