Skip to content

Commit

Permalink
Consistently using case instead of if for conditionals in script boil…
Browse files Browse the repository at this point in the history
…erplate.
  • Loading branch information
daniel-baumann committed Aug 13, 2012
1 parent ba42304 commit 4ecca9f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
13 changes: 9 additions & 4 deletions scripts/boot/0110-debug
Expand Up @@ -13,10 +13,15 @@ Debug ()
esac
done

if [ "${LIVE_DEBUG}" != "true" ]
then
return 0
fi
case "${LIVE_DEBUG}" in
true)
;;

*)
return 0
;;
esac

# Write the trace output
set -x
}
12 changes: 8 additions & 4 deletions scripts/boot/0120-read-only
Expand Up @@ -18,10 +18,14 @@ Read_only ()
esac
done

if [ "${LIVE_READ_ONLY}" != "true" ]
then
return 0
fi
case "${LIVE_READ_ONLY}" in
true)
;;

*)
return 0
;;
esac

# Marking some block devices as read-only to ensure that nothing
# gets written as linux still writes to 'only' read-only mounted filesystems.
Expand Down
12 changes: 8 additions & 4 deletions scripts/boot/3010-verify-checksums
Expand Up @@ -18,10 +18,14 @@ Verify_checksums ()
esac
done

if [ "${LIVE_VERIFY_CHECKSUMS}" != "true" ]
then
return 0
fi
case "${LIVE_VERIFY_CHECKSUMS}" in
true)
;;

*)
return 0
;;
esac

_MOUNTPOINT="${1}"

Expand Down
12 changes: 8 additions & 4 deletions scripts/boot/3020-swapon
Expand Up @@ -18,10 +18,14 @@ Swap ()
esac
done

if [ "${LIVE_SWAP}" != "true" ]
then
return 0
fi
case "${LIVE_SWAP}" in
true)
;;

*)
return 0
;;
esac

LIVE_SWAP_DEVICES="${LIVE_SWAP_DEVICES:-/dev/sd* /dev/vd*}"

Expand Down

0 comments on commit 4ecca9f

Please sign in to comment.