# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Okt 04 22:52:03 CEST 2006 [mika]
+# Latest change: Fre Mär 16 16:04:18 CET 2007 [mika]
################################################################################
# colors {{{
echo 1>&2 "${RED}Error: syslinux is not available. Please install it before running this script.${NORMAL}" ; exit 2
fi
- if [ "$UID" != 0 ]; then
+ if [ "$(id -u)" != 0 ]; then
echo 1>&2 "${RED}Error: please run this script with uid 0 (root).${NORMAL}" ; exit 1
fi
# }}}
# set variables {{{
- if [[ $DEBUG -gt 0 ]]; then
+ if [ -n "$DEBUG" ]; then
# set -x
debugit(){
echo $*
}
fi
- if [ "$1" == "uninstall" ] ; then
+ if [ "$1" = "uninstall" ] ; then
UNINSTALL=1
fi
LANGUAGE='C'
LC_ALL='C'
PROGRAMNAME=${0##*/}
- VERSION='0.6'
+ VERSION='0.7.4'
ISO="$1"
DEVICE="$2"
[ -n "$TMPMNT" ] || TMPMNT='/mnt/test'
echo "Exiting - umounting /mnt/test and $DEVICE"
umount /mnt/test 2>/dev/null
umount $DEVICE 2>/dev/null
- exit 1
+ exit 2
}
usage()
mount_iso(){
echo -n "Mounting ${ISO} to ${TMPMNT}: "
debugit "debug: mount -o loop ${ISO} ${TMPMNT}"
- if mount -o loop ${ISO} ${TMPMNT} ; then
+ if mount -o loop "${ISO}" ${TMPMNT} ; then
echo "${WHITE}done${NORMAL}"
else
echo 1>&2 "${RED}Problem? You got an error saying 'mount: could not find any free loop device'?
Possible solution: losetup -d /dev/loop/0${NORMAL}"
- exit 1
+ exit 3
fi
}
# main program {{{
trap bailout 1 2 3 15
-if [[ $# != 2 ]]; then
- usage ; exit 1
+if [ "$#" != 2 ]; then
+ usage ; exit 4
fi
if [ -n "$UNINSTALL" ] ; then