summaryrefslogtreecommitdiff
path: root/contrib/eventcmd-examples/eventcmd.sh
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-03-06 16:03:13 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-03-06 16:03:13 +0100
commitb6a0245796794228614c092c63b51bf50970fa08 (patch)
treefab95834d42c6330289fffe97fdb1b857f51ddca /contrib/eventcmd-examples/eventcmd.sh
parent7956d1a2f83bcb0d82da6af34a621709a21407cb (diff)
downloadpianobar-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-xcontrib/eventcmd-examples/eventcmd.sh2
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