diff options
author | Bob Igo <bob@stormlogic.com> | 2009-06-06 16:48:58 (GMT) |
---|---|---|
committer | Bob Igo <bob@stormlogic.com> | 2009-06-06 16:48:58 (GMT) |
commit | 4d49c500658b2e9c06742f0930dd203448ecabb3 (patch) | |
tree | a055d83a69415a79b9a8df37b3db4bba7398a3fb /abs/core-testing/LinHES-config-svn/install_functions.sh | |
parent | 870b21903c0898f2d71b4686b36ccc744a257b2c (diff) | |
download | linhes_pkgbuild-4d49c500658b2e9c06742f0930dd203448ecabb3.zip linhes_pkgbuild-4d49c500658b2e9c06742f0930dd203448ecabb3.tar.gz linhes_pkgbuild-4d49c500658b2e9c06742f0930dd203448ecabb3.tar.bz2 |
General bash comparison syntax cleanup.
Diffstat (limited to 'abs/core-testing/LinHES-config-svn/install_functions.sh')
-rwxr-xr-x | abs/core-testing/LinHES-config-svn/install_functions.sh | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/abs/core-testing/LinHES-config-svn/install_functions.sh b/abs/core-testing/LinHES-config-svn/install_functions.sh index ddade6d..4f6f7ed 100755 --- a/abs/core-testing/LinHES-config-svn/install_functions.sh +++ b/abs/core-testing/LinHES-config-svn/install_functions.sh @@ -38,7 +38,7 @@ update_db_settings Theme "$pick" function splash_setup (){ echo $CMDLINE | grep -q splash=silent - if [ $? = 0 ] + if [ $? -eq 0 ] then update_db_settings Hostbootsplash 1 else @@ -61,7 +61,7 @@ function setupremote { update_db_settings HostRemoteType "$Remotetype" #special case for special remote echo "Starting with support for $Remotetype" - if [ x$Remotetype = "xdvico" ] + if [ "$Remotetype" == "dvico" ] then /usr/sbin/lircd -d /dev/usb/hiddev0 else @@ -79,7 +79,7 @@ echo "Scanning for Hauppauge receiver" for hpgid in `lspci -nm -d4444: |cut -d" " -f6- |tr -d '"'|tr " " :` do line=`grep $hpgid $TEMPLATES/remotes/i2c.id` - if [ $? = 0 ] + if [ $? -eq 0 ] then modprobe lirc_i2c FoundReceiverType=`echo "$line"|cut -d"|" -f2` @@ -102,7 +102,7 @@ while read line do USBID=`echo "$line"|cut -d"|" -f1` lsusb -d "$USBID" > /dev/null 2>/dev/null - if [ $? = 0 ] + if [ $? -eq 0 ] then Remotetype=`echo "$line"|cut -d"|" -f2` echo "Found $Remotetype" @@ -111,7 +111,7 @@ do break fi done <$BASE/$TEMPLATES/remotes/receiver_usb.id -if [ $found_remote = 1 ] +if [ $found_remote -eq 1 ] then scan_for_hpg_receiver fi @@ -125,7 +125,7 @@ fi function rest_of_network () { #netmask echo $CMDLINE | grep -q netmask - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*netmask=} NETMASK=${TEMPVAR%% *} @@ -139,7 +139,7 @@ function rest_of_network () { fi #gateway echo $CMDLINE | grep -q gateway - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*gateway=} GATEWAY=${TEMPVAR%% *} @@ -152,7 +152,7 @@ function rest_of_network () { #dns echo $CMDLINE | grep -q dns - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*dns=} DNS=${TEMPVAR%% *} @@ -165,7 +165,7 @@ function rest_of_network () { function init_network { echo $CMDLINE |grep -q netdev - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*netdev=} MYTHDEFAULT=${TEMPVAR%% *} @@ -176,7 +176,7 @@ function init_network { echo $CMDLINE | grep -q ip - if [ $? = 0 ] + if [ $? -eq 0 ] then update_db_settings HostDefaulteth0 0 update_db_settings HostDefault${MYTHDEFAULT} 1 @@ -187,7 +187,7 @@ function init_network { TEMPVAR=${CMDLINE#*ip=} IP=${TEMPVAR%% *} - if [ x$IP = xdhcp ] + if [ "$IP" == "dhcp" ] then /sbin/dhcpcd $MYTHDEFAULT update_db_settings HostUseDHCP${MYTHDEFAULT} 0 @@ -202,11 +202,11 @@ function init_network { function init_remote { echo $CMDLINE | grep -q remoteport - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*remoteport=} REMOTEPORT=${TEMPVAR%% *} - if [ x"$ReceiverType" = "xSerial" ] + if [ "$ReceiverType" == "Serial" ] then if [ -e /dev/$REMOTEPORT ] then @@ -220,7 +220,7 @@ function init_remote { fi echo $CMDLINE | grep -q remote - if [ $? = 0 ] + if [ $? -eq 0 ] then TEMPVAR=${CMDLINE#*remote=} Remotetype=${TEMPVAR%% *} @@ -239,7 +239,7 @@ ROOT=$1 DATA=$2 SWAP=$3 -if [ ! x$SWAP = xNO ] +if [ "$SWAP" != "NO" ] then SWAPLINE=",$SWAP,S" MKSWAPCMD="mkswap /dev/${disk}2" @@ -248,7 +248,7 @@ if [ ! x$SWAP = xNO ] MKSWAPCMD="" fi -if [ x$DATA = xALL ] +if [ "$DATA" == "ALL" ] then DATALINE=",,," EXTRALINE="" @@ -315,7 +315,7 @@ unmount_it () { copy_it () { - if [ x$1 = xALL ] + if [ "$1" == "ALL" ] then echo "Transferring system" unsquashfs -f -d /$mountpoint /.livesys/medium/system.sqf @@ -403,7 +403,7 @@ function find_uuid() { get_grub_map() { - rm /tmp/dev.map + [ -e /tmp/dev.map ] && rm /tmp/dev.map /sbin/grub --no-floppy --device-map /tmp/dev.map <<EOF quit EOF @@ -422,17 +422,17 @@ mapdev() { fi for dev in $devs do - if [ "(" = $(echo $dev | cut -b1) ]; then + if [ "(" == $(echo $dev | cut -b1) ]; then grubdevice="$dev" else - if [ "$dev" = "$linuxdevice" ]; then + if [ "$dev" == "$linuxdevice" ]; then device_found=1 break fi fi done - if [ "$device_found" = "1" ]; then - if [ "$partition_flag" = "0" ]; then + if [ "$device_found" == "1" ]; then + if [ "$partition_flag" == "0" ]; then echo "$grubdevice" else grubdevice_stringlen=${#grubdevice} @@ -461,7 +461,7 @@ dogrub() { #/usr/sbin/xfs_freeze -f /$mountpoint > /dev/null 2>&1 echo "freezing xfs fs" /usr/sbin/xfs_freeze -f /$mountpoint - if [ $? = 0 ] + if [ $? -eq 0 ] then sleep 40 echo "unfreezing xfs" @@ -531,7 +531,7 @@ case $1 in create_fstab fi #was 5 - if [ x$3 = xUPGRADE ] + if [ "$3" == "UPGRADE" ] then if [ ! -f /tmp/etc/KnoppMyth-version ] then @@ -558,11 +558,11 @@ case $1 in SWAPUUID=$FOUNDUUID FOUNDUUID="" - if [ x$4 = x ] + if [ "$4" == "" ] then #upgrade find_uuid ${2}3 - elif [ x$5 = xFULL_INSTALL ] + elif [ "$5" == "FULL_INSTALL" ] then #install find_uuid ${2}3 @@ -585,7 +585,7 @@ case $1 in if [ -f /tmp/etc/fstab ] then grep -q /dev/vg /tmp/etc/fstab - if [ $? = 0 ] + if [ $? -eq 0 ] then grep /dev/vg /tmp/etc/fstab >> /$mountpoint/etc/fstab grep /dev/vg /tmp/etc/fstab | awk -v mount=$mountpoint ' { print "/" mount $2 }' |xargs mkdir |