Consistently using curly brackets for variables.
authorDaniel Baumann <daniel@debian.org>
Mon, 24 Sep 2007 07:45:11 +0000 (09:45 +0200)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:31:05 +0000 (17:31 +0100)
26 files changed:
bin/live-preseed
bin/live-reconfigure
bin/live-snapshot
debian/init
scripts/live
scripts/live-bottom/02etc_live_conf
scripts/live-bottom/02timezone
scripts/live-bottom/10adduser
scripts/live-bottom/12fstab
scripts/live-bottom/13swap
scripts/live-bottom/15autologin
scripts/live-bottom/18hostname
scripts/live-bottom/19keyboard
scripts/live-bottom/20xconfig
scripts/live-bottom/22gnome_panel_data
scripts/live-bottom/22screensaver
scripts/live-bottom/23etc_modules
scripts/live-bottom/23networking
scripts/live-bottom/25configure_init
scripts/live-bottom/30accessibility
scripts/live-bottom/32disable_hibernation
scripts/live-bottom/33enable_apport_crashes
scripts/live-bottom/40install_driver_updates
scripts/live-functions
scripts/live-helpers
scripts/live-premount/10driver_updates

index 3bdd8ce..36154ea 100755 (executable)
@@ -4,20 +4,20 @@ set -e
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
-root="$1"
-question="$2"
-value="$3"
-seen="$4"
+root="${1}"
+question="${2}"
+value="${3}"
+seen="${4}"
 
-[ "$seen" ] || seen=true
+[ "${seen}" ] || seen=true
 
-if ! (echo "SET $question $value"; echo "FSET $question seen $seen") | chroot "$1" debconf-communicate -fnoninteractive live-initramfs >/dev/null
+if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null
 then
 
-chroot "$1" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
-REGISTER debian-installer/dummy $question
-SET $question $value
-FSET $question seen $seen
+chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
+REGISTER debian-installer/dummy ${question}
+SET ${question} ${value}
+FSET ${question} seen ${seen}
 EOF
 
 fi
index 565bdea..16cb51d 100755 (executable)
@@ -8,31 +8,31 @@ frontend=noninteractive
 
 findcommandinroot ()
 {
-       ROOT="$1/"
+       ROOT="${1}/"
        shift
 
-       while [ "$#" -ge 1 ]
+       while [ "${#}" -ge 1 ]
        do
-               P="$PATH"
+               P="${PATH}"
 
-               while [ "$P" ]
+               while [ "${P}" ]
                do
                        D=${P%%:*}
                        P=${P#*:}
 
-                       if [ "$D" = "$P" ]
+                       if [ "${D}" = "${P}" ]
                        then
                                P=
                        fi
 
-                       if [ -z "$D" ]
+                       if [ -z "${D}" ]
                        then
                                D=.
                        fi
 
-                       if [ -x "$ROOT$D/$1" ]
+                       if [ -x "${ROOT}${D}/${1}" ]
                        then
-                               echo "$D/$1"
+                               echo "${D}/${1}"
                                return 0
                        fi
                done
@@ -45,26 +45,26 @@ findcommandinroot ()
 
 runcommandinroot ()
 {
-       C=$(findcommandinroot "$1" "$2")
-       ROOT="$1"
+       C=$(findcommandinroot "${1}" "${2}")
+       ROOT="${1}"
 
        shift
        shift
 
-       [ -n "$C" ] && chroot "$ROOT" "$C" "$@"
+       [ -n "${C}" ] && chroot "${ROOT}" "${C}" "${@}"
 }
 
-root="$1"
-package="$2"
+root="${1}"
+package="${2}"
 
-version=$(runcommandinroot "$root" dpkg-query -W --showformat='${Version}' "$package" 2>/dev/null) || version=""
+version=$(runcommandinroot "${root}" dpkg-query -W --showformat='${Version}' "${package}" 2>/dev/null) || version=""
 
-if [ -z "$version" ]
+if [ -z "${version}" ]
 then
-       echo >&2 "$0: package '$package' is not installed"
+       echo >&2 "${0}: package '${package}' is not installed"
        exit 0
 fi
 
-runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package"
+runcommandinroot "${root}" dpkg-reconfigure -fnoninteractive --no-reload "${package}"
 
 exit 0
index 989fd3a..e508c2a 100755 (executable)
@@ -99,7 +99,7 @@ Help ()
        echo "Options:"
        echo "  -c, --cow: specifies the copy on write directory (default: /live/cow)."
        echo "  -d, --device: specifies the output snapshot device (default: none)."
-       echo "  -o, --output: specifies the output image file (default: $type dependent)."
+       echo "  -o, --output: specifies the output image file (default: ${type} dependent)."
     echo "  -r, --resync-string: internally used to resync previous made snapshots."
        echo "  -t, --type: specifies the snapshot type between \"squashfs\", \"ext2\", \"ext3\" or \"cpio\".gz archive (default: cpio)"
     echo -e "\nLook at live-snapshot(1) man page for more information."
@@ -164,8 +164,8 @@ Do_snapshot ()
 
 Is_same_mount ()
 {
-       dir1="$(Base_path $1)"
-       dir2="$(Base_path $2)"
+       dir1="$(Base_path ${1})"
+       dir2="$(Base_path ${2})"
 
        if [ "${dir1}" = "${dir2}" ]
        then
@@ -178,10 +178,10 @@ Is_same_mount ()
 Parse_args ()
 {
        # Parse command line
-       ARGS="$1"
+       ARGS="${1}"
        ARGUMENTS="$(getopt --longoptions cow:,device:,output,resync-string:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:r:,h,u,v --shell sh -- ${ARGS})"
 
-       if [ "$?" != "0" ]
+       if [ "${?}" != "0" ]
        then
                echo "Terminating." >&2
                exit 1
@@ -191,29 +191,29 @@ Parse_args ()
 
        while true
        do
-               case "$1" in
+               case "${1}" in
                        -c|--cow)
-                               SNAP_COW="$2"
+                               SNAP_COW="${2}"
                                shift 2
                                ;;
 
                        -d|--device)
-                               SNAP_DEV="$2"
+                               SNAP_DEV="${2}"
                                shift 2
                                ;;
 
                        -o|--output)
-                               SNAP_OUTPUT="$2"
+                               SNAP_OUTPUT="${2}"
                                shift 2
                                ;;
 
                        -t|--type)
-                               SNAP_TYPE="$2"
+                               SNAP_TYPE="${2}"
                                shift 2
                                ;;
 
                        -r|--resync-string)
-                               SNAP_RSTRING="$2"
+                               SNAP_RSTRING="${2}"
                                break
                                ;;
 
@@ -243,7 +243,7 @@ Parse_args ()
 
 Mount_device ()
 {
-       dev="$1"
+       dev="${1}"
 
        if [ ! -d "${MOUNTP}" ]
        then
@@ -255,9 +255,9 @@ Mount_device ()
                # create a temp
                mount -t tmpfs -o rw tmpfs "${MOUNTP}"
 
-               if [ ! -L /home/$USERNAME/Desktop/live-snapshot ]
+               if [ ! -L /home/${USERNAME}/Desktop/live-snapshot ]
                then
-                       ln -s "${MOUNTP}" /home/$USERNAME/Desktop/live-snapshot
+                       ln -s "${MOUNTP}" /home/${USERNAME}/Desktop/live-snapshot
                fi
        else
                if [ -b "${dev}" ]
@@ -274,7 +274,7 @@ Defaults ()
        DEV=""
        DEST="${MOUNTP}/live-sn.cpio.gz"
        TYPE="cpio"
-       DESKTOP_LINK=/home/$USERNAME/Desktop/live-snapshot
+       DESKTOP_LINK=/home/${USERNAME}/Desktop/live-snapshot
 
        if [ -n "${SNAP_RSTRING}" ]
        then
@@ -334,12 +334,12 @@ Defaults ()
                Usage "Error: ${COW} is not a directory"
        fi
 
-       Mount_device $DEV
+       Mount_device ${DEV}
 }
 
 Clean ()
 {
-       if [ -n "$DEV" ]
+       if [ -n "${DEV}" ]
        then
                umount "${MOUNTP}"
                rmdir "${MOUNTP}"
@@ -349,10 +349,10 @@ Clean ()
 
 Main ()
 {
-       Parse_args "$@"
+       Parse_args "${@}"
        Defaults
        Do_snapshot
        Clean
 }
 
-Main "$@"
+Main "${@}"
index d515c39..b083781 100644 (file)
@@ -37,30 +37,30 @@ grep -qs boot=live /proc/cmdline || exit 0
 # Try to cache everything we're likely to need after ejecting.  This
 # is fragile and simple-minded, but our options are limited.
 cache_path() {
-    path="$1"
-
-    if [ -d "$path" ]; then
-        find "$path" -type f | xargs cat > /dev/null 2>&1
-    elif [ -f "$path" ]; then
-        if [ -x "$path" ]; then
-            if file "$path" | grep -q 'dynamically linked'; then
-                for lib in $(ldd "$path" | awk '{ print $3 }'); do
-                    cache_path "$lib"
+    path="${1}"
+
+    if [ -d "${path}" ]; then
+        find "${path}" -type f | xargs cat > /dev/null 2>&1
+    elif [ -f "${path}" ]; then
+        if [ -x "${path}" ]; then
+            if file "${path}" | grep -q 'dynamically linked'; then
+                for lib in $(ldd "${path}" | awk '{ print $3 }'); do
+                    cache_path "${lib}"
                 done
             fi
         fi
-        cat "$path" >/dev/null 2>&1
+        cat "${path}" >/dev/null 2>&1
     fi
 }
 
 do_stop ()
 {
     if [ ! -z "${ROOTSNAP}" ]; then
-        $DO_SNAPSHOT --resync-string="${ROOTSNAP}"
+        ${DO_SNAPSHOT} --resync-string="${ROOTSNAP}"
     fi
 
     if [ ! -z "${HOMESNAP}" ]; then
-        $DO_SNAPSHOT --resync-string="${HOMESNAP}"
+        ${DO_SNAPSHOT} --resync-string="${HOMESNAP}"
     fi
 
     # check for netboot
@@ -69,11 +69,11 @@ do_stop ()
     fi
 
     for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default; do
-        cache_path "$path"
+        cache_path "${path}"
     done
 
     for x in $(cat /proc/cmdline); do
-       case $x in
+       case ${x} in
            quickreboot)
                QUICKREBOOT="Yes"
            ;;
@@ -98,20 +98,20 @@ do_stop ()
     fi
 }
 
-case "$1" in
+case "${1}" in
     start|restart|reload|force-reload|status)
-        [ "$VERBOSE" != no ] && log_end_msg 0
+        [ "${VERBOSE}" != no ] && log_end_msg 0
         ;;
     stop)
         log_begin_msg "${NAME} is resyncing snapshots and caching reboot files..."
         do_stop
-        case "$?" in
-            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        case "${?}" in
+            0|1) [ "${VERBOSE}" != no ] && log_end_msg 0 ;;
+            2) [ "${VERBOSE}" != no ] && log_end_msg 1 ;;
         esac
         ;;
     *)
-        log_success_msg "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+        log_success_msg "Usage: ${SCRIPTNAME} {start|stop|restart|force-reload}" >&2
         exit 3
         ;;
 esac
index 47b4469..76adec0 100755 (executable)
@@ -314,14 +314,14 @@ Arguments ()
 
                                mkdir -p /root/var/run/network
                                chroot /root ifup -a
-                               chroot /root wget -P /tmp "$location"
+                               chroot /root wget -P /tmp "${location}"
                                chroot /root ifdown -a
 
                                umount /root/sys
                                umount /root/proc
                                umount /root/dev
 
-                               LOCATION="/tmp/$(basename "$location")"
+                               LOCATION="/tmp/$(basename "${location}")"
                                ;;
 
                        */*=*)
@@ -431,9 +431,9 @@ is_live_path ()
 
 get_backing_device ()
 {
-       case "$1" in
+       case "${1}" in
                *.squashfs|*.ext2|*.ext3)
-                       echo $(setup_loop "$1" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
+                       echo $(setup_loop "${1}" "loop" "/sys/block/loop*" '0' "${LIVE_MEDIA_ENCRYPTION}")
                        ;;
 
                *.dir)
@@ -441,17 +441,17 @@ get_backing_device ()
                        ;;
 
                *)
-                       panic "Unrecognized live filesystem: $1"
+                       panic "Unrecognized live filesystem: ${1}"
                        ;;
        esac
 }
 
 match_files_in_dir ()
 {
-       # Does any files match pattern $1 ?
-       local pattern="$1"
+       # Does any files match pattern ${1} ?
+       local pattern="${1}"
 
-       if [ "$(echo $pattern)" != "$pattern" ]
+       if [ "$(echo ${pattern})" != "${pattern}" ]
        then
                return 0
        fi
@@ -461,15 +461,15 @@ match_files_in_dir ()
 
 mount_images_in_directory ()
 {
-       directory="$1"
-       rootmnt="$2"
+       directory="${1}"
+       rootmnt="${2}"
 
-       if match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.squashfs" ||
-               match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.ext2" ||
-               match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.ext3" ||
-               match_files_in_dir "$directory/${LIVE_MEDIA_PATH}/*.dir"
+       if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
+               match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" ||
+               match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
+               match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir"
        then
-               setup_unionfs "$directory/${LIVE_MEDIA_PATH}" "$rootmnt"
+               setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}"
        else
                :
        fi
@@ -517,7 +517,7 @@ copy_live_to ()
                then
                        size=$( expr $(ls -la ${MODULETORAMFILE} | awk '{print $5}') / 1024 + 5000 )
                else
-                       log_warning_msg "Error: toram-module $MODULETORAM ($MODULETORAMFILE) could not be read."
+                       log_warning_msg "Error: toram-module ${MODULETORAM} (${MODULETORAMFILE}) could not be read."
                        return 1
                fi
        fi
@@ -546,7 +546,7 @@ copy_live_to ()
 
        if [ "${freespace}" -lt "${size}" ]
        then
-               [ "$quiet" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
+               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
                return 1
        fi
 
@@ -555,7 +555,7 @@ copy_live_to ()
        echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
        mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
 
-       if [ "$extension" = "tgz" ]
+       if [ "${extension}" = "tgz" ]
        then
                cd "${copyto}"
                tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
@@ -591,9 +591,9 @@ do_netmount ()
        ipconfig ${DEVICE} | tee /netboot.config
 
        # source relevant ipconfig output
-       OLDHOSTNAME=$HOSTNAME
+       OLDHOSTNAME=${HOSTNAME}
        . /tmp/net-${DEVICE}.conf
-       [ -z $HOSTNAME ] && HOSTNAME=$OLDHOSTNAME
+       [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
        export HOSTNAME
 
        if [ "${NFSROOT}" = "auto" ]
@@ -607,12 +607,12 @@ do_netmount ()
                return ${rc}
        fi
 
-       if [ "${NFSROOT#*:}" = "$NFSROOT" ] && [ "$NETBOOT" != "cifs" ]
+       if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
        then
                NFSROOT=${ROOTSERVER}:${NFSROOT}
        fi
 
-       [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
+       [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
 
        if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
        then
@@ -624,7 +624,7 @@ do_netmount ()
                rc=0
        fi
 
-       [ "$quiet" != "y" ] && log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
        return ${rc}
 }
 
@@ -635,15 +635,15 @@ do_httpmount ()
 
        case "${extension}" in
                squashfs|tgz|tar)
-                       [ "$quiet" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})"
+                       [ "${quiet}" != "y" ] && log_begin_msg "Trying wget ${FETCH} -O ${mountpoint}/$(basename ${FETCH})"
                        mkdir -p "${mountpoint}/${LIVE_MEDIA_PATH}"
                        wget "${FETCH}" -O "${mountpoint}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
-                       [ $? -eq 0 ] && rc=0
+                       [ ${?} -eq 0 ] && rc=0
                        [ "${extension}" == "tgz" ] && live_dest="ram"
                        ;;
 
                *)
-                       [ "$quiet" != "y" ] && log_begin_msg "Unrecognized archive extension for ${FETCH}"
+                       [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${FETCH}"
        esac
 
        return ${rc}
@@ -660,7 +660,7 @@ do_nfsmount ()
                NFSOPTS=""
        fi
 
-       [ "$quiet" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
+       [ "${quiet}" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
 
        # FIXME: This for loop is an ugly HACK round an nfs bug
        for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
@@ -685,7 +685,7 @@ do_cifsmount ()
                        CIFSOPTS="${NFSOPTS}"
                fi
 
-               [ "$quiet" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
+               [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
                modprobe "${MP_QUIET}" cifs
 
                if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
@@ -745,13 +745,13 @@ do_snap_copy ()
        else
                return 1
 
-               [ "$quiet" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
+               [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
        fi
 }
 
 try_snap ()
 {
-       # Look for $snap_label.* in block devices and copy the contents to $snap_mount
+       # Look for ${snap_label}.* in block devices and copy the contents to ${snap_mount}
        # and remember the device and filename for resync on exit in live-initramfs.init
 
        snap_label="${1}"
@@ -823,8 +823,8 @@ try_snap ()
 
 setup_unionfs ()
 {
-       image_directory="$1"
-       rootmnt="$2"
+       image_directory="${1}"
+       rootmnt="${2}"
 
        modprobe "${MP_QUIET}" -b ${UNIONTYPE}
 
@@ -893,7 +893,7 @@ setup_unionfs ()
                        rofslist="${image} ${rofslist}"
                elif [ -f "${image}" ]
                then
-                       backdev=$(get_backing_device "$image")
+                       backdev=$(get_backing_device "${image}")
                        fstype=$(get_fstype "${backdev}")
 
                        if [ "${fstype}" = "unknown" ]
@@ -902,8 +902,8 @@ setup_unionfs ()
                        fi
 
                        mkdir -p "${croot}/${imagename}"
-                       echo "debug: Can not mount backdev $backdev (image = $image) on croot/imagename ${croot}/${imagename}"
-                       mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount $backdev ($image) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+                       echo "debug: Can not mount backdev ${backdev} (image = ${image}) on croot/imagename ${croot}/${imagename}"
+                       mount -t "${fstype}" -o ro "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
                fi
        done
 
@@ -923,13 +923,13 @@ setup_unionfs ()
                        cowdevice=${cowprobe}
                        cow_fstype=$(get_fstype "${cowprobe}")
                else
-                       [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent medium"
+                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
                fi
        fi
 
-       mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount $cowdevice on /cow"
+       mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount ${cowdevice} on /cow"
 
-       mount -t ${UNIONTYPE} -o dirs=/cow=rw:$rofsstring ${UNIONTYPE} "$rootmnt" || panic "${UNIONTYPE} mount failed"
+       mount -t ${UNIONTYPE} -o dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
 
        # Adding other custom mounts
        if [ -n "${PERSISTENT}" ]
@@ -943,7 +943,7 @@ setup_unionfs ()
                        mount -t $(get_fstype "${homecow}") -o rw "${homecow}" "${rootmnt}/home"
                        export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
                else
-                       [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
+                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
                fi
 
                # Look for other snapshots to copy in
@@ -994,14 +994,14 @@ check_dev ()
 
        if is_supported_fs ${fstype}
        then
-               mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
+               mount -t ${fstype} -o ro "${devname}" ${mountpoint} || continue
 
-               if is_live_path $mountpoint
+               if is_live_path ${mountpoint}
                then
-                       echo $mountpoint
+                       echo ${mountpoint}
                        return 0
                else
-                       umount $mountpoint
+                       umount ${mountpoint}
                fi
        fi
 
@@ -1098,10 +1098,10 @@ mountroot ()
        Arguments
 
        set_usplash_timeout
-       [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-premount"
+       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
        pulsate
        run_scripts /scripts/live-premount
-       [ "$quiet" != "y" ] && log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
 
        # Needed here too because some things (*cough* udev *cough*)
        # changes the timeout
@@ -1120,7 +1120,7 @@ mountroot ()
                # Scan local devices for the image
                for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
                do
-                       livefs_root=$(find_livefs $i)
+                       livefs_root=$(find_livefs ${i})
 
                        if [ -n "${livefs_root}" ]
                        then
@@ -1153,7 +1153,7 @@ mountroot ()
 
        if [ -n "${MODULETORAMFILE}" ]
        then
-               setup_unionfs "${livefs_root}" "$rootmnt"
+               setup_unionfs "${livefs_root}" "${rootmnt}"
        else
                mount_images_in_directory "${livefs_root}" "${rootmnt}"
        fi
@@ -1161,11 +1161,11 @@ mountroot ()
        log_end_msg
 
        maybe_break live-bottom
-       [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
+       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
 
        pulsate
        run_scripts /scripts/live-bottom
-       [ "$quiet" != "y" ] && log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
 
        exec 1>&6 6>&-
        exec 2>&7 7>&-
index 48b12d1..1623de8 100755 (executable)
@@ -41,9 +41,9 @@ then
 else
 
 cat > /root/etc/live.conf << EOF
-export USERNAME="$USERNAME"
-export USERFULLNAME="$USERFULLNAME"
-export HOSTNAME="$HOSTNAME"
+export USERNAME="${USERNAME}"
+export USERFULLNAME="${USERFULLNAME}"
+export HOSTNAME="${HOSTNAME}"
 EOF
 
 fi
index e272da9..e4e91ff 100755 (executable)
@@ -37,8 +37,8 @@ then
        zone="$(echo ${TIMEZONE} | cut -f2 -d '/')"
 
 chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
-set tzdata/Areas $area
-set tzdata/Zones/$area $zone
+set tzdata/Areas ${area}
+set tzdata/Zones/${area} ${zone}
 EOF
 
        cp -f /root/usr/share/zoneinfo/${area}/${zone} /root/etc/localtime
index ed2e14e..d76f143 100755 (executable)
@@ -43,8 +43,8 @@ chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<
 set passwd/make-user true
 set passwd/root-password-crypted *
 set passwd/user-password-crypted ${user_crypted}
-set passwd/user-fullname $USERFULLNAME
-set passwd/username $USERNAME
+set passwd/user-fullname ${USERFULLNAME}
+set passwd/username ${USERNAME}
 set passwd/user-uid 999
 EOF
 
@@ -80,9 +80,9 @@ then
 
                        for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop
                        do
-                               if [ -f "/root/$file" ]
+                               if [ -f "/root/${file}" ]
                                then
-                                       chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
+                                       chroot /root install -D -o ${USERNAME} -g ${USERNAME} ${file} /home/${USERNAME}/Desktop/$(basename "${file}")
                                        break
                                fi
                        done
@@ -112,15 +112,15 @@ EOF
        fi
 fi
 
-if [ -L /root/home/$USERNAME/Examples ]
+if [ -L /root/home/${USERNAME}/Examples ]
 then
-       chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
-       mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/
+       chroot /root install -o ${USERNAME} -g ${USERNAME} -d /home/${USERNAME}/Desktop/
+       mv /root/home/${USERNAME}/Examples /root/home/${USERNAME}/Desktop/
 fi
 
 if [ -f "/root/usr/share/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop.tobemoved" ]
 then
-       chroot /root install -D -o $USERNAME -g $USERNAME /usr/share/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop.tobemoved /home/$USERNAME/Desktop/about-kubuntu.desktop
+       chroot /root install -D -o ${USERNAME} -g ${USERNAME} /usr/share/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop.tobemoved /home/${USERNAME}/Desktop/about-kubuntu.desktop
 fi
 
 log_end_msg
index 73e18d4..3d036c9 100755 (executable)
@@ -33,7 +33,7 @@ log_begin_msg "Configuring fstab..."
 
 FSTAB=/root/etc/fstab
 
-cat >> $FSTAB << EOF
+cat >> ${FSTAB} << EOF
 ${UNIONTYPE} / ${UNIONTYPE} rw 0 0
 tmpfs /tmp tmpfs nosuid,nodev 0 0
 EOF
index 4980433..f3af1cc 100755 (executable)
@@ -36,25 +36,25 @@ devices=""
 
 for device in /dev/[hs]d[a-z][0-9]*
 do
-       if ! [ -b "$device" ]
+       if ! [ -b "${device}" ]
        then
                continue
        fi
 
-       magic=$(/bin/dd if="$device" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
+       magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
 
-       if [ "$magic" = "SWAPSPACE2" -o "$magic" = "SWAP-SPACE" ]
+       if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
        then
-               #log "Found $device"
-               devices="$devices $device"
+               #log "Found ${device}"
+               devices="${devices} ${device}"
        fi
 done
 
-for device in $devices
+for device in ${devices}
 do
 
-cat >> $FSTAB << EOF
-$device swap swap defaults 0 0
+cat >> ${FSTAB} << EOF
+${device} swap swap defaults 0 0
 EOF
 
 done
index 40383cb..b0ce90d 100755 (executable)
@@ -51,9 +51,9 @@ then
        # Configure GDM autologin
        chroot /root \
        sed -i -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
-              -e "s/^AutomaticLogin=.*\$/AutomaticLogin=$USERNAME/" \
+              -e "s/^AutomaticLogin=.*\$/AutomaticLogin=${USERNAME}/" \
               -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
-              -e "s/^TimedLogin=.*\$/TimedLogin=$USERNAME/" \
+              -e "s/^TimedLogin=.*\$/TimedLogin=${USERNAME}/" \
               -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
        ${GDMCONF}
 fi
@@ -62,7 +62,7 @@ if [ -f /root/etc/kde3/kdm/kdmrc ]
 then
        # Configure KDM autologin
        sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
-                 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
+                 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=${USERNAME}/" \
                  -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
        /root/etc/kde3/kdm/kdmrc
 fi
index ac35389..1dbb897 100755 (executable)
@@ -31,11 +31,11 @@ log_begin_msg "Setting hostname..."
 
 # live-initramfs script
 
-echo "$HOSTNAME" > /root/etc/hostname
+echo "${HOSTNAME}" > /root/etc/hostname
 
 cat >> /root/etc/hosts << EOF
 127.0.0.1 localhost
-127.0.1.1 $HOSTNAME
+127.0.1.1 ${HOSTNAME}
 
 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
index ef91c90..784aa05 100755 (executable)
@@ -63,22 +63,22 @@ fi
 
 if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]
 then
-       if [ "$cslayout" ]
+       if [ "${cslayout}" ]
        then
-               chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \
+               chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"${cslayout}\"/" \
                /etc/default/console-setup
 
-               if [ "$csvariant" ]
+               if [ "${csvariant}" ]
                then
-                       chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"$csvariant\"/" \
+                       chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"${csvariant}\"/" \
                        /etc/default/console-setup
                else
                        live-preseed /root console-setup/variantcode '' false
                fi
 
-               if [ "$csmodel" ]
+               if [ "${csmodel}" ]
                then
-                       chroot /root sed -i "s/^XKBMODEL=.*/XKBMODEL=\"$csmodel\"/" \
+                       chroot /root sed -i "s/^XKBMODEL=.*/XKBMODEL=\"${csmodel}\"/" \
                        /etc/default/console-setup
                else
                        live-preseed /root console-setup/modelcode '' false
@@ -91,9 +91,9 @@ then
 
        sed -i 's/CONSOLE_SCREEN=$/CONSOLE_SCREEN=setupcon/; t END; b; : END; n; b END' /root/etc/init.d/usplash
 else
-       chroot /root /usr/sbin/install-keymap $kbd
-       live-preseed /root debian-installer/keymap "$kbd"
-       live-preseed /root kbd-chooser/method "$kbd"
+       chroot /root /usr/sbin/install-keymap ${kbd}
+       live-preseed /root debian-installer/keymap "${kbd}"
+       live-preseed /root kbd-chooser/method "${kbd}"
 fi
 
 log_end_msg
index 902335e..8d315a5 100755 (executable)
@@ -31,7 +31,7 @@ log_begin_msg "Configuring X..."
 
 # live-initramfs script
 
-if [ "$TERM_TYPE" = "serial" ]
+if [ "${TERM_TYPE}" = "serial" ]
 then
        # Don't bother trying to configure or start X on a serial console
        rm -f /etc/rc?.d/S??[gxk]dm
index 8e071d3..8322c9c 100755 (executable)
@@ -41,9 +41,9 @@ fi
 
 panel_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-panel-data 2>/dev/null) || panel_version=""
 
-if [ -n "$panel_version" ]
+if [ -n "${panel_version}" ]
 then
-       chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
 fi
 
 log_end_msg
index e161da6..0b70452 100755 (executable)
@@ -32,14 +32,16 @@ log_begin_msg "Configuring screensaver..."
 # live-initramfs script
 
 gnome_screensaver_version=$(chroot /root dpkg-query -W --showformat='${Version}' gnome-screensaver 2>/dev/null) || gnome_screensaver_version=""
-if [ -n "$gnome_screensaver_version" ]; then
-    # Support legacy gconf value
-    chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/gnome-screensaver/lock false
-    chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
+
+if [ -n "${gnome_screensaver_version}" ]
+then
+       # Support legacy gconf value
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock false
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
 fi
 
 if [ -d /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config ]; then
-    printf "[ScreenSaver]\nLock=false\n" >> /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kdesktoprc
+       printf "[ScreenSaver]\nLock=false\n" >> /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kdesktoprc
 fi
 
 log_end_msg
index b73a107..4cc300a 100755 (executable)
@@ -27,7 +27,7 @@ log_begin_msg "Preconfiguring /etc/modules..."
 # live-initramfs script
 
 # load the right modules
-case "$DPKG_ARCH" in
+case "${DPKG_ARCH}" in
        powerpc|ppc64)
                echo snd_powermac >> /root/etc/modules
                ;;
index aeff351..603116f 100755 (executable)
@@ -33,14 +33,14 @@ log_begin_msg "Preconfiguring networking..."
 
 IFFILE="/root/etc/network/interfaces"
 
-if [ "${STATICIP}" = "frommedia" -a -e  "$IFFILE" ]
+if [ "${STATICIP}" = "frommedia" -a -e  "${IFFILE}" ]
 then
        # will use existent /etc/network/interfaces
        log_end_msg
        exit 0
 fi
 
-cat > "$IFFILE" << EOF
+cat > "${IFFILE}" << EOF
 auto lo
 iface lo inet loopback
 
@@ -60,7 +60,7 @@ then
                ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
                ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
 
-cat >> "$IFFILE" << EOF
+cat >> "${IFFILE}" << EOF
 auto ${ifname}
 iface ${ifname} inet static
     address ${ifaddress}
@@ -82,16 +82,16 @@ else
        fi
 
        # iterate the physical interfaces and add them to the interfaces list
-       if [ "$method" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ]
+       if [ "${method}" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ]
        then
                for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
                do
-                       [ -e $interface ] || continue
-                       i="$(basename $interface)"
+                       [ -e ${interface} ] || continue
+                       i="$(basename ${interface})"
 
-cat >> "$IFFILE" << EOF
-auto $i
-iface $i inet $method
+cat >> "${IFFILE}" << EOF
+auto ${i}
+iface ${i} inet ${method}
 
 EOF
 
@@ -132,11 +132,11 @@ fi
 #then
 #      for i in eth0 eth1 eth2 ath0 wlan0
 #      do
-#              grep -q "iface $i" $IFFILE && continue
+#              grep -q "iface ${i}" ${IFFILE} && continue
 #
-#cat >> "$IFFILE" << EOF
-#auto $i
-#iface $i inet dhcp
+#cat >> "${IFFILE}" << EOF
+#auto ${i}
+#iface ${i} inet dhcp
 #
 #EOF
 #
index e30261a..b2a191c 100755 (executable)
@@ -30,7 +30,7 @@ log_begin_msg "Setting up init..."
 
 if [ -z "${NOAUTOLOGIN}" ]
 then
-       if [ -n "$USERNAME" ]
+       if [ -n "${USERNAME}" ]
        then
                if [ ! -z "${LIVE_GETTY}" ]
                then
@@ -47,9 +47,9 @@ then
                                then
                                        IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9"
 
-                                       for ID1 in $IDs
+                                       for ID1 in ${IDs}
                                        do
-                                               for ID2 in $IDs
+                                               for ID2 in ${IDs}
                                                do
                                                        ID="${ID1}${ID2}"
 
@@ -72,21 +72,21 @@ then
                else
                        if [ -f /root/etc/inittab ]
                        then
-                               sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
+                               sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f ${USERNAME} </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
                        fi
 
                        if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]
                        then
                                for f in /root/etc/event.d/tty*
                                do
-                                       sed -i -e "s|^respawn.*|respawn /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
+                                       sed -i -e "s|^respawn.*|respawn /bin/login -f ${USERNAME} </dev/$(basename ${f}) > /dev/$(basename ${f}) 2>\&1|" ${f}
                                done
 
                                if [ "${BUILD_SYSTEM}" = "Ubuntu" ]
                                then
                                        for x in $(cat /proc/cmdline)
                                        do
-                                               case $x in
+                                               case ${x} in
                                                        noninteractive)
                                                                sed -i -e "s|^exec.*|exec /usr/bin/ubiquity noninteractive </dev/tty1 > /dev/tty1 2>\&1|" /root/etc/event.d/tty1
                                                                rm -f /root/etc/rc?.d/[SK]??gdm
index 17defbf..4726a75 100755 (executable)
@@ -35,9 +35,9 @@ gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gc
 
 gct ()
 {
-       if [ "$gconf_version" ]
+       if [ "${gconf_version}" ]
        then
-               chroot /root sudo -u "$USERNAME" gconftool-2 "$@"
+               chroot /root sudo -u "${USERNAME}" gconftool-2 "${@}"
        fi
 }
 
index 0965c73..708db5c 100755 (executable)
@@ -33,11 +33,11 @@ log_begin_msg "Configuring power management..."
 
 gpm_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-power-manager 2>/dev/null) || panel_version=""
 
-if [ -n "$gpm_version" ]
+if [ -n "${gpm_version}" ]
 then
        #live-reconfigure /root gnome-power-manager
-       chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/gnome-power-manager/can_hibernate false
-       chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/gnome-power-manager/can_suspend false
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gnome-power-manager/can_hibernate false
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gnome-power-manager/can_suspend false
 fi
 
 if [ -d /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config ]
index 747ba26..f300652 100755 (executable)
@@ -33,9 +33,9 @@ log_begin_msg "Enabling notifications about program crashes..."
 
 update_notifier_version=$(chroot /root dpkg-query -W --showformat='${Version}' update-notifier 2>/dev/null) || update_notifier_version=""
 
-if [ -n "$update_notifier_version" ]
+if [ -n "${update_notifier_version}" ]
 then
-       chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/update-notifier/show_apport_crashes true
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/update-notifier/show_apport_crashes true
 fi
 
 log_end_msg
index 762a084..584dcd0 100755 (executable)
@@ -33,18 +33,18 @@ log_begin_msg "Installing driver updates..."
 
 install_dir=/var/cache/driver-updates
 
-mkdir "/root$install_dir"
-cp -a /tmp/driver-updates/*.deb "/root$install_dir/"
+mkdir "/root${install_dir}"
+cp -a /tmp/driver-updates/*.deb "/root${install_dir}/"
 
 # We cannot leave packages in a bad state. So if the install fails, remove
 # it. This will get caught in live.log.
-for deb in "/root$install_dir"/*
+for deb in "/root${install_dir}"/*
 do
-       [ -f "$deb" ] || continue
+       [ -f "${deb}" ] || continue
 
        debbase="${deb##*/}"
 
-       if ! chroot /root dpkg -i "$install_dir/$debbase"
+       if ! chroot /root dpkg -i "${install_dir}/${debbase}"
        then
                chroot /root dpkg -P "${debbase%%_*}"
        fi
index baa920c..6fb57c6 100644 (file)
@@ -19,11 +19,11 @@ log_wait_msg ()
        # Print a message and wait for enter
        if [ -x /sbin/usplash_write ]
        then
-               /sbin/usplash_write "INPUTENTER $@"
+               /sbin/usplash_write "INPUTENTER ${@}"
                read nunya < /dev/.initramfs/usplash_outfifo
        fi
 
-       _log_msg "Waiting: $@ ..."
+       _log_msg "Waiting: ${@} ..."
 }
 
 really_export ()
index f4dae34..e74108c 100644 (file)
@@ -25,7 +25,7 @@ sys2dev ()
 
 subdevices ()
 {
-       sysblock=$1
+       sysblock=${1}
        r=""
 
        for dev in "${sysblock}" "${sysblock}"/*
@@ -44,25 +44,25 @@ get_fstype ()
        local FSTYPE
        local FSSIZE
 
-       eval $(fstype < $1)
+       eval $(fstype < ${1})
 
-       if [ "$FSTYPE" != "unknown" ]
+       if [ "${FSTYPE}" != "unknown" ]
        then
-               echo $FSTYPE
+               echo ${FSTYPE}
                return 0
        fi
 
-       /lib/udev/vol_id -t $1 2>/dev/null
+       /lib/udev/vol_id -t ${1} 2>/dev/null
 }
 
 where_is_mounted ()
 {
-       device=$1
+       device=${1}
 
-       if grep -q "^$device " /proc/mounts
+       if grep -q "^${device} " /proc/mounts
        then
-               grep "^$device " /proc/mounts | read d mountpoint rest
-               echo $mountpoint
+               grep "^${device} " /proc/mounts | read d mountpoint rest
+               echo ${mountpoint}
                return 0
        fi
 
@@ -101,7 +101,7 @@ base_path ()
 fs_size ()
 {
        # Returns used/free fs kbytes + 5% more
-       # You could pass a block device as $1 or the mount point as $2
+       # You could pass a block device as ${1} or the mount point as ${2}
 
        dev="${1}"
        mountp="${2}"
@@ -111,7 +111,7 @@ fs_size ()
        then
                mountp=$(where_is_mounted "${dev}")
 
-               if [ "$?" -gt 0 ]
+               if [ "${?}" -gt 0 ]
                then
                        mountp="/mnt/tmp_fs_size"
 
@@ -151,18 +151,18 @@ load_keymap ()
 
 setup_loop ()
 {
-       local fspath=$1
-       local module=$2
-       local pattern=$3
-       local offset=$4
-       local encryption=$5
+       local fspath=${1}
+       local module=${2}
+       local pattern=${3}
+       local offset=${4}
+       local encryption=${5}
 
-       modprobe ${MP_QUIET} -b "$module"
+       modprobe ${MP_QUIET} -b "${module}"
        udevsettle
 
-       for loopdev in $pattern
+       for loopdev in ${pattern}
        do
-               if [ "$(cat $loopdev/size)" -eq 0 ]
+               if [ "$(cat ${loopdev}/size)" -eq 0 ]
                then
                        dev=$(sys2dev "${loopdev}")
                        options=''
@@ -186,7 +186,7 @@ setup_loop ()
                                        echo "${passphrase}" > /tmp/passphrase
                                        exec 9</tmp/passphrase
                                        /sbin/losetup ${options} -e "${encryption}" -p 9 "${dev}" "${fspath}"
-                                       error=$?
+                                       error=${?}
                                        exec 9<&-
                                        rm -f /tmp/passphrase
 
@@ -207,7 +207,7 @@ setup_loop ()
                                done
                        fi
 
-                       echo "$dev"
+                       echo "${dev}"
                        return 0
                fi
        done
@@ -241,9 +241,9 @@ find_cow_device ()
                do
                        devname=$(sys2dev "${dev}")
 
-                       if [ "$(/lib/udev/vol_id -l $devname 2>/dev/null)" = "${pers_label}" ]
+                       if [ "$(/lib/udev/vol_id -l ${devname} 2>/dev/null)" = "${pers_label}" ]
                        then
-                               echo "$devname"
+                               echo "${devname}"
                                return
                        elif [ "$(get_fstype ${devname})" = "vfat" ]
                        then
@@ -265,7 +265,7 @@ find_cow_device ()
 
 find_files ()
 {
-       # return the first of $filenames found on vfat and ext2/ext3 devices
+       # return the first of ${filenames} found on vfat and ext2/ext3 devices
        # FIXME: merge with above function
 
        filenames="${1}"
index 0a88724..22d64d2 100755 (executable)
@@ -40,16 +40,16 @@ is_updates_path ()
        # subdirectory. Each package contains a module for a specific
        # kernel flavour.
 
-       path=$1
+       path=${1}
        kbase=$(uname -r | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\)-.*/\1/')
-       update_dir="$path/ubuntu-drivers/$kbase"
+       update_dir="${path}/ubuntu-drivers/${kbase}"
 
-       if [ -d "$update_dir" ]
+       if [ -d "${update_dir}" ]
        then
-               if [ "$(echo $update_dir/*_$DPKG_ARCH.deb)" != \
-                       "$update_dir/*_$DPKG_ARCH.deb" ]
+               if [ "$(echo ${update_dir}/*_${DPKG_ARCH}.deb)" != \
+                       "${update_dir}/*_${DPKG_ARCH}.deb" ]
                then
-                       echo "$update_dir"
+                       echo "${update_dir}"
                        return 0;
                fi
        fi
@@ -99,11 +99,11 @@ check_dev_updates ()
        then
                mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
 
-               if is_updates_path $mountpoint
+               if is_updates_path ${mountpoint}
                then
                        return 0
                else
-                       umount $mountpoint
+                       umount ${mountpoint}
                fi
        fi
 
@@ -150,14 +150,14 @@ updates="false"
 
 for x in $(cat /proc/cmdline)
 do
-       case $x in
+       case ${x} in
                debian-installer/driver-update=*)
                        updates=${x#debian-installer/driver-update=}
                        ;;
        esac
 done
 
-if [ "$updates" != "true" ]
+if [ "${updates}" != "true" ]
 then
        log_end_msg
        exit 0
@@ -183,7 +183,7 @@ then
        eject
 fi
 
-log_wait_msg "Insert a driver CD and press ENTER ($DPKG_ARCH)"
+log_wait_msg "Insert a driver CD and press ENTER (${DPKG_ARCH})"
 
 log_begin_msg "Looking for driver update CD"
 
@@ -211,8 +211,8 @@ fi
 log_begin_msg "Copying driver updates to temporary location"
 
 mkdir -p /tmp/driver-updates
-cp $updates_root/*_$DPKG_ARCH.deb /tmp/driver-updates/
-umount $mountpoint
+cp ${updates_root}/*_${DPKG_ARCH}.deb /tmp/driver-updates/
+umount ${mountpoint}
 
 if [ -x /usr/bin/eject ]
 then