From: <kr...@us...> - 2007-11-19 18:36:08
|
Revision: 1380 http://astlinux.svn.sourceforge.net/astlinux/?rev=1380&view=rev Author: krisk84 Date: 2007-11-19 10:36:03 -0800 (Mon, 19 Nov 2007) Log Message: ----------- don't start interfaces if they are configured as none, dnsmasq init fix Modified Paths: -------------- trunk/package/dnsmasq/dnsmasq.init trunk/package/iptables/astfw trunk/target/generic/target_skeleton/etc/init.d/network Modified: trunk/package/dnsmasq/dnsmasq.init =================================================================== --- trunk/package/dnsmasq/dnsmasq.init 2007-11-16 21:58:04 UTC (rev 1379) +++ trunk/package/dnsmasq/dnsmasq.init 2007-11-19 18:36:03 UTC (rev 1380) @@ -18,17 +18,17 @@ touch /var/db/dnsmasq.leases fi -if [ "$INTIF" -a "$INTIP" ] +if [ "$INTIF" -a "$INTIP" -a ! "$INTIF" = "none" ] then LANIPBASE=`echo $INTIP | cut -d. -f1-3` fi -if [ "$INT2IF" -a "$INT2IP" ] +if [ "$INT2IF" -a "$INT2IP" -a ! "$INT2IF" = "none" ] then LAN2IPBASE=`echo $INT2IP | cut -d. -f1-3` fi -if [ "$INT3IF" -a "$INT3IP" ] +if [ "$INT3IF" -a "$INT3IP" -a ! "$INT3IF" = "none" ] then LAN3IPBASE=`echo $INT3IP | cut -d. -f1-3` fi @@ -162,7 +162,7 @@ echo "# Create /mnt/kd/dnsmasq.static to specify additional settings." >> /tmp/etc/dnsmasq.conf # read static mappings from a file -if [ -e /mnt/kd/dnsmasq.static ] +if [ -r /mnt/kd/dnsmasq.static ] then echo "conf-file=/mnt/kd/dnsmasq.static" >> /tmp/etc/dnsmasq.conf fi Modified: trunk/package/iptables/astfw =================================================================== --- trunk/package/iptables/astfw 2007-11-16 21:58:04 UTC (rev 1379) +++ trunk/package/iptables/astfw 2007-11-19 18:36:03 UTC (rev 1380) @@ -9,17 +9,17 @@ DACTION=DROP fi -if [ "$INTIF" ] +if [ "$INTIF" -a ! "$INTIF" = "none" ] then IPBASE=`echo $INTIP | cut -d. -f1-3` fi -if [ "$INT2IF" ] +if [ "$INT2IF" -a ! "$INT2IF" = "none" ] then IP2BASE=`echo $INT2IP | cut -d. -f1-3` fi -if [ "$INT3IF" ] +if [ "$INT3IF" -a ! "$INT3IF" = "none" ] then IP3BASE=`echo $INT3IP | cut -d. -f1-3` fi @@ -59,17 +59,17 @@ #Allow INPUT from INTIF -if [ "$INTIF" ] +if [ "$INTIF" -a ! "$INTIF" = "none" ] then iptables -A INPUT -i $INTIF -j ACCEPT fi -if [ "$INT2IF" ] +if [ "$INT2IF" -a ! "$INT2IF" = "none" ] then iptables -A INPUT -i $INT2IF -j ACCEPT fi -if [ "$INT3IF" ] +if [ "$INT3IF" -a ! "$INT3IF" = "none" ] then iptables -A INPUT -i $INT3IF -j ACCEPT fi @@ -94,7 +94,7 @@ fi #DMZ Support -if [ "$DMZIF" ] +if [ "$DMZIF" -a ! "$DMZIF" = "none" ] then for i in $EXTIFS @@ -187,17 +187,17 @@ for i in $EXTIFS do -if [ "$INTIF" ] +if [ "$INTIF" -a ! "$INTIF" = "none" ] then iptables -A FORWARD -i $INTIF -o $i -j ACCEPT fi -if [ "$INT2IF" ] +if [ "$INT2IF" -a ! "$INT2IF" = "none" ] then iptables -A FORWARD -i $INT2IF -o $i -j ACCEPT fi -if [ "$INT3IF" ] +if [ "$INT3IF" -a ! "$INT3IF" = "none" ] then iptables -A FORWARD -i $INT3IF -o $i -j ACCEPT fi @@ -393,7 +393,7 @@ for i in $EXTIFS do -if [ "$INTIF" -a "$INTIFNAT" = "on" ] +if [ "$INTIF" -a "$INTIFNAT" = "on" -a ! "$INTIF" = "none" ] then if [ "$MASQPORTS" ] then @@ -403,7 +403,7 @@ iptables -t nat -A POSTROUTING -s $IPBASE.0/$INTNM -o $i -j MASQUERADE fi -if [ "$INT2IF" -a "$INT2IFNAT" = "on" ] +if [ "$INT2IF" -a "$INT2IFNAT" = "on" -a ! "$INT2IF" = "none" ] then if [ "$MASQPORTS" ] then @@ -414,7 +414,7 @@ fi -if [ "$INT3IF" -a "$INT3IFNAT" = "on" ] +if [ "$INT3IF" -a "$INT3IFNAT" = "on" -a ! "$INT3IF" = "none" ] then if [ "$MASQPORTS" ] then Modified: trunk/target/generic/target_skeleton/etc/init.d/network =================================================================== --- trunk/target/generic/target_skeleton/etc/init.d/network 2007-11-16 21:58:04 UTC (rev 1379) +++ trunk/target/generic/target_skeleton/etc/init.d/network 2007-11-19 18:36:03 UTC (rev 1380) @@ -186,23 +186,23 @@ done fi -if [ "$INTIF" -a "$INTIP" -a "$INTNM" ] +if [ "$INTIF" -a "$INTIP" -a "$INTNM" -a ! "$INTIF" = "none" ] then echo "Bringing up $INTIF as $INTIP" ifconfig "$INTIF" "$INTIP" netmask "$INTNM" fi -if [ "$INT2IF" -a "$INT2IP" -a "$INT2NM" ] +if [ "$INT2IF" -a "$INT2IP" -a "$INT2NM" -a ! "$INT2IF" = "none" ] then ifconfig "$INT2IF" "$INT2IP" netmask "$INT2NM" fi -if [ "$INT3IF" -a "$INT3IP" -a "$INT3NM" ] +if [ "$INT3IF" -a "$INT3IP" -a "$INT3NM" -a ! "$INT3IF" = "none" ] then ifconfig "$INT3IF" "$INT3IP" netmask "$INT3NM" fi -if [ "$EXTIF" -a "$EXTIFMAC" ] +if [ "$EXTIF" -a "$EXTIFMAC" -a ! "$EXTIF" = "none" ] then ifconfig $EXTIF hw ether $EXTIFMAC 2>/dev/null fi @@ -354,7 +354,7 @@ fi ##DMZ Network -if [ "$DMZIF" -a "$DMZIP" -a "$DMZNM" ] +if [ "$DMZIF" -a "$DMZIP" -a "$DMZNM" -a ! "$DMZIF" = "none" ] then echo "Bringing up $DMZIF as $DMZIP" ifconfig "$DMZIF" "$DMZIP" netmask "$DMZNM" @@ -362,31 +362,31 @@ } stop () { -if [ "$EXTIF" ] +if [ "$EXTIF" -a ! "$EXTIF" = "none" ] then echo "Bringing down $EXTIF ..." ifconfig "$EXTIF" down fi -if [ "$INTIF" ] +if [ "$INTIF" -a ! "$EXTIF" = "none" ] then echo "Bringing down $INTIF ..." ifconfig "$INTIF" down fi -if [ "$INT2IF" ] +if [ "$INT2IF" -a ! "$INT2IF" = "none" ] then echo "Bringing down $INT2IF ..." ifconfig "$INT2IF" down fi -if [ "$INT3IF" ] +if [ "$INT3IF" -a ! "$INT3IF" = "none" ] then echo "Bringing down $INT3IF ..." ifconfig "$INT3IF" down fi -if [ "$DMZIF" ] +if [ "$DMZIF" -a ! "$DMZIF" = "none"] then echo "Bringing down $DMZIF ..." ifconfig "$DMZIF" down This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |