Revision: 432
http://ipcop.svn.sourceforge.net/ipcop/?rev=432&view=rev
Author: gespinasse
Date: 2007-07-14 05:08:16 -0700 (Sat, 14 Jul 2007)
Log Message:
-----------
Forward changes from 1.4
Add a missing call to readhash dhcp/settings
Use full path for ifconfig
Do not mix preparation for rc.red and dnsmasq start
This does not change actions order, only preparation to make code more
readable.
Fix a typo with RED is ethernet comment
Replace wrong comment and commented code by what we really do and why
for rc.red and dnsmasq
Modified Paths:
--------------
ipcop/trunk/config/rc.d/rc.netaddress.up
Modified: ipcop/trunk/config/rc.d/rc.netaddress.up
===================================================================
--- ipcop/trunk/config/rc.d/rc.netaddress.up 2007-07-07 16:46:36 UTC (rev 431)
+++ ipcop/trunk/config/rc.d/rc.netaddress.up 2007-07-14 12:08:16 UTC (rev 432)
@@ -3,8 +3,9 @@
# $Id$
#
-eval $(/usr/local/bin/readhash CONFIG_ROOT/ppp/settings)
+eval $(/usr/local/bin/readhash CONFIG_ROOT/dhcp/settings)
eval $(/usr/local/bin/readhash CONFIG_ROOT/ethernet/settings)
+eval $(/usr/local/bin/readhash CONFIG_ROOT/ppp/settings)
echo "Setting up IPCOP firewall rules"
/etc/rc.d/rc.firewall start
@@ -24,7 +25,7 @@
if [ "$1" != "NOTGREEN" ]; then
if [ "$GREEN_DEV" != "" ]; then
- ifconfig $GREEN_DEV $GREEN_ADDRESS netmask $GREEN_NETMASK broadcast $GREEN_BROADCAST up
+ /sbin/ifconfig $GREEN_DEV $GREEN_ADDRESS netmask $GREEN_NETMASK broadcast $GREEN_BROADCAST up
else
echo "WARNING: No driver set for GREEN"
fi
@@ -32,18 +33,29 @@
if [ "$CONFIG_TYPE" = "1" -o "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "5" -o "$CONFIG_TYPE" = "7" ]; then
if [ "$ORANGE_DEV" != "" ]; then
- ifconfig $ORANGE_DEV $ORANGE_ADDRESS netmask $ORANGE_NETMASK broadcast $ORANGE_BROADCAST up
+ /sbin/ifconfig $ORANGE_DEV $ORANGE_ADDRESS netmask $ORANGE_NETMASK broadcast $ORANGE_BROADCAST up
fi
fi
if [ "$CONFIG_TYPE" = "4" -o "$CONFIG_TYPE" = "5" -o "$CONFIG_TYPE" = "6" -o "$CONFIG_TYPE" = "7" ]; then
if [ "$BLUE_DEV" != "" ]; then
- ifconfig $BLUE_DEV $BLUE_ADDRESS netmask $BLUE_NETMASK broadcast $BLUE_BROADCAST up
+ /sbin/ifconfig $BLUE_DEV $BLUE_ADDRESS netmask $BLUE_NETMASK broadcast $BLUE_BROADCAST up
fi
fi
-# If RED is ethernet then check furthur...
+# rc.netaddress.up may be called with dnsmasq already running on network reconfiguration
+# not sure if this will stay relevant if setup diseappear (Gilles)
+/bin/killall -KILL dnsmasq 2> /dev/null
+/bin/sleep 1
+
+# Start DNSMASQ with defaults settings to resolve names defined in /etc/hosts
+# Start in any cases : even if rc.red start fail, we still want be able to use /etc/hosts names
+OPT_DNSMASQ="-l /var/state/dhcp/dhcpd.leases"
+[ -n $DOMAIN_NAME_GREEN ] && OPT_DNSMASQ="--domain=$DOMAIN_NAME_GREEN $OPT_DNSMASQ"
+/usr/sbin/dnsmasq $OPT_DNSMASQ
+
+# If RED is ethernet then check further...
if [ "$CONFIG_TYPE" == "2" -o "$CONFIG_TYPE" == "3" -o "$CONFIG_TYPE" == "6" -o "$CONFIG_TYPE" == "7" ]; then
# If we are DHCP or STATIC we have to start automatically
if [ "$RED_TYPE" == "DHCP" -o "$RED_TYPE" == "STATIC" ]; then
@@ -51,21 +63,6 @@
fi
fi
-
-# Start DNSMASQ with defaults
-if [ "$DOMAIN_NAME_GREEN" == "" ]; then
- /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases
-else
- /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases -s "$DOMAIN_NAME_GREEN"
-fi
-
-# Only when AUTOCONNECT is off, do we not bother dialing but start local dns server
-if [ "$AUTOCONNECT" == "off" ]; then
- # Start VPN Connections # bug 1177572 might be corrected because this
- # /usr/local/bin/ipsecctrl S # call was done to much earlier (before RED start)
- # Presently commented because I'm not sure VPN is usefull without RED
- echo -n # bash do not like empty then ... else
-
-else
+if [ "$AUTOCONNECT" != "off" ]; then
/etc/rc.d/rc.red start
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|