Changeset 2937 in MondoRescue for branches/3.1/mindi/rootfs/sbin/start-netfs
- Timestamp:
- Jan 28, 2012, 1:51:28 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mindi/rootfs/sbin/start-netfs
r2709 r2937 10 10 ipcount=3 11 11 12 ipconf="" 13 pre="" 14 post="" 12 # Get info from config file 15 13 ipdev="" 14 hwaddr="" 16 15 ipaddress="" 17 16 ipnetmask="" … … 19 18 ipgateway="" 20 19 proto="" 20 ipconf="" 21 pre="" 22 post="" 21 23 netfsmount="" 22 24 imgname="" … … 26 28 if [ -f $MINDI_CACHE/mondorestore.cfg ]; then 27 29 ipdev=`grep netfs-dev $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 30 hwaddr=`grep netfs-client-hwaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 28 31 ipaddress=`grep netfs-client-ipaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` 29 32 ipnetmask=`grep netfs-client-netmask $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-` … … 46 49 for i in `cat $CMDLINE` ; do 47 50 echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2` 51 echo $i | grep -qi hwaddr= && hwaddr=`echo $i | cut -d= -f2` 48 52 echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2` 49 53 echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2` … … 93 97 ipgateway=`echo $ipconf | cut -d: -f5` 94 98 fi 99 100 # If same system, map to the right MAC address 101 hwaddr_found=`ifconfig $ipdev | /bin/grep HWaddr | awk '{print $NF}'` 102 if [ "$hwaddr" != "$hwaddr_found" ]; then 103 ipdev_new=`ifconfig -a | /bin/grep $hwaddr | awk '{print $1}'` 104 if [ "$ipdev_new" != "" ]; then 105 LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)" 106 ipdev=$ipdev_new 107 else 108 LogIt "NOTE: Interface $ipdev kept despite it doesn't match the $hwaddr MAC address" 109 fi 110 fi 111 95 112 LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)" 96 113 ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast 97 114 route add default gw $ipgateway 115 98 116 fi 117 118 # Leave time to the satck to wake up (reported by some users) 119 sleep 5 99 120 100 121 # ping server helps waking interface up
Note:
See TracChangeset
for help on using the changeset viewer.