# search in /proc/mounts for the device that is mounted at /lib/live/mount/medium
while read DEVICE MOUNT REST
do
- if [ "${MOUNT}" = "/lib/live/mount/medium" ]
- then
- echo "${DEVICE}"
- exit 0
- fi
+ case "${MOUNT}" in
+ /lib/live/mount/medium)
+ echo "${DEVICE}"
+ exit 0
+ ;;
+ esac
done < /proc/mounts
}
# "ejected" state even after reboot
MESSAGE="Please remove the USB flash drive"
- if [ "${NOPROMPT}" = "usb" ]
- then
- prompt=
- fi
-
+ case "${NOPROMPT}" in
+ usb)
+ prompt=
+ ;;
+ esac
else
# ejecting is a very good idea here
MESSAGE="Please remove the disc, close the tray (if any)"
eject -p -m /lib/live/mount/medium >/dev/null 2>&1
fi
- if [ "${NOPROMPT}" = "cd" ]
- then
- prompt=
- fi
+ case "${NOPROMPT}" in
+ cd)
+ prompt=
+ ;;
+ esac
fi
[ "$prompt" ] || return 0
echo "live-boot: caching reboot files..."
prompt=1
-if [ "${NOPROMPT}" = "Yes" ]
-then
- prompt=
-fi
+
+case "${NOPROMPT}" in
+ yes)
+ prompt=
+ ;;
+esac
for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default $(which stty) /bin/plymouth
do
fi
# Make sure user is not in sudo group if sudo is disabled
- if [ "${_NOROOT}" = "true" ]
- then
- LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|sudo||')"
- fi
+ case "${_NOROOT}" in
+ true)
+ LIVE_USER_DEFAULT_GROUPS="$(echo ${LIVE_USER_DEFAULT_GROUPS} | sed -e 's|sudo||')"
+ ;;
+ esac
# Default password is: live
# passwords can be generated with 'echo "live" | mkpasswd -s',
Xinit ()
{
# Checking if a display manager has been configured
- if [ "${_X11}" = "true" ]
- then
- rm -f /etc/profile.d/zz-live.sh
+ case "${_X11}" in
+ true)
+ rm -f /etc/profile.d/zz-live.sh
- return
- fi
+ return
+ ;;
+ esac
# Checking if package is installed or already configured
if [ ! -e /var/lib/dpkg/info/xinit.list ] || \