diff options
author | smos <seth.mos@dds.nl> | 2012-05-26 09:28:42 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-05-26 09:28:42 +0200 |
commit | 2f8782fe42f50018491279bba74db54e5bfffeed (patch) | |
tree | 98609522578dae6c17dc5eb61b2945f7f6b4c4da | |
parent | 17d656fc95258dd39787923216336264132a8640 (diff) | |
download | pfsense-2f8782fe42f50018491279bba74db54e5bfffeed.zip pfsense-2f8782fe42f50018491279bba74db54e5bfffeed.tar.gz |
More validation for ejecting CDrom devices for 3G sticks, needs extra manufacturers. Less typos in variable names also helps a lot.
-rwxr-xr-x | etc/rc | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -86,9 +86,11 @@ if [ -f /etc/rc.disable_hdd_apm ]; then fi #Eject CD devices on 3G modems -MANUFATURER="huawei|zte" -CDDEVICE=`dmesg |egrep -ei "($MANUFACTURER)" | awk '/cd/ {print $1}'` -cdcontrol -f /dev/"$CDDEVICE" eject +MANUFACTURER="huawei|zte" +CDDEVICE=`dmesg |egrep -ie "($MANUFACTURER)" | awk -F: '/cd/ {print $1}'` +if [ "$CDDEVICE" != "" ]; then + cdcontrol -f /dev/"$CDDEVICE" eject +fi if [ ! "$PLATFORM" = "jail" ]; then # Check to see if a compact flash mountpoint exists |