Skip to content

Commit

Permalink
Test if BOOT_PATH and ROOT_PATH are unset rather than their default v…
Browse files Browse the repository at this point in the history
…alues, fixes Hexxeh#11
  • Loading branch information
adammw committed Jun 19, 2012
1 parent e1c7f9e commit faad48b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rpi-update
Expand Up @@ -6,6 +6,12 @@ set -o errexit
UPDATE=${UPDATE:-1}
UPDATE_URI="https://github.com/Hexxeh/rpi-update/raw/master/rpi-update"

if [[ ${BOOT_PATH:-"unset"} == "unset" && ${ROOT_PATH:-"unset"} != "unset" ]] ||
[[ ${BOOT_PATH:-"unset"} != "unset" && ${ROOT_PATH:-"unset"} == "unset" ]]; then
echo "You need to specify both ROOT_PATH and BOOT_PATH, or neither"
exit 1
fi

ROOT_PATH=${ROOT_PATH:-"/"}
BOOT_PATH=${BOOT_PATH:-"/boot"}
SKIP_KERNEL=${SKIP_KERNEL:-0}
Expand Down Expand Up @@ -167,12 +173,6 @@ if [[ ${UPDATE} -ne 0 ]]; then
update_self
fi

if [[ ( "${ROOT_PATH}" == "/" && "${BOOT_PATH}" != "/boot" ) ]] ||
[[ ( "${BOOT_PATH}" == "/boot" && "${ROOT_PATH}" != "/" ) ]]; then
echo "You need to specify both ROOT_PATH and BOOT_PATH, or neither"
exit 1
fi

if [[ ! -d "${FW_PATH}" ]]; then
echo "${FW_PATH} doesn't exist"
exit 1
Expand Down

0 comments on commit faad48b

Please sign in to comment.