Permalink
Browse files

Fix crash if download mirror 0 is selected

  • Loading branch information...
1 parent 319ba20 commit 52d93d7a99b19cb5635c6a24d0893be84feff813 @asergi committed Apr 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 jdownloader
View
@@ -38,7 +38,8 @@ notify() {
download_updater() {
RANDOM_NUMBER=$(dd if=/dev/urandom count=1 2>/dev/null | cksum | cut -f1 -d" ")
- MIRROR=http://update$(expr $RANDOM_NUMBER % $NUMBER_OF_UPDATE_MIRRORS).jdownloader.org/
+ MIRROR_NUMBER=$(expr "$RANDOM_NUMBER" % "$NUMBER_OF_UPDATE_MIRRORS" || true)
+ MIRROR="http://update${MIRROR_NUMBER}.jdownloader.org/"
rm -f jdupdate.jar
echo "$0: Download jdupdate.jar from $MIRROR." >> "$LOG_FILE"

0 comments on commit 52d93d7

Please sign in to comment.