Replaced if with case

Because bash is the devil ;)
This commit is contained in:
James Belchamber 2013-09-01 12:41:19 +01:00
parent c3f556486e
commit 76cc529617

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
@ -50,18 +50,19 @@ if [ -z "$1" ]; then
fi
DISK="$1"
if [[ "$DISK" = "/dev/mmcblk"* ]]; then
PART1="${DISK}p1"
PART2="${DISK}p2"
elif [[ "$DISK" = "/dev/loop"* ]]; then
PART1="${DISK}p1"
PART2="${DISK}p2"
IMGFILE="$2"
losetup $DISK $IMGFILE
else
PART1="${DISK}1"
PART2="${DISK}2"
fi
case $DISK in
"/dev/mmcblk1"*)
PART1="${DISK}p1";
PART2="${DISK}p2";;
"/dev/loop"*)
PART1="${DISK}p1";
PART2="${DISK}p2";
IMGFILE="$2";
losetup $DISK $IMGFILE;;
*)
PART1="${DISK}1";
PART2="${DISK}2";;
esac
clear
echo "#########################################################"