mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
Netzwerkscripts: DHCP vollstaendig getestet und gefixt.
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@790 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -15,16 +15,33 @@
|
|||||||
. /etc/sysconfig/rc
|
. /etc/sysconfig/rc
|
||||||
. ${rc_functions}
|
. ${rc_functions}
|
||||||
|
|
||||||
|
SHOW_SRV=1
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
start)
|
start)
|
||||||
boot_mesg "Starting Domain Name Service Proxy..."
|
boot_mesg "Starting Domain Name Service Proxy..."
|
||||||
|
|
||||||
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||||
ARGS=
|
ARGS=
|
||||||
[ "$DOMAIN_NAME_GREEN" != "" ] && ARGS="-s $DOMAIN_NAME_GREEN "
|
[ "$DOMAIN_NAME_GREEN" != "" ] && ARGS="-s $DOMAIN_NAME_GREEN"
|
||||||
[ -e "/var/ipfire/red/active" ] && ARGS+="-r /var/ipfire/red/resolv.conf"
|
|
||||||
|
echo > /var/ipfire/red/resolv.conf # Clear it
|
||||||
|
if [ -e "/var/ipfire/red/dns1" ]; then
|
||||||
|
DNS1=$(cat /var/ipfire/red/dns1 2>/dev/null)
|
||||||
|
echo "nameserver ${DNS1}" >> /var/ipfire/red/resolv.conf
|
||||||
|
fi
|
||||||
|
if [ -e "/var/ipfire/red/dns2" ]; then
|
||||||
|
DNS2=$(cat /var/ipfire/red/dns2 2>/dev/null)
|
||||||
|
echo "nameserver ${DNS2}" >> /var/ipfire/red/resolv.conf
|
||||||
|
fi
|
||||||
|
[ -e "/var/ipfire/red/active" ] && ARGS="$ARGS -r /var/ipfire/red/resolv.conf"
|
||||||
|
|
||||||
loadproc /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases $ARGS
|
loadproc /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases $ARGS
|
||||||
|
|
||||||
|
if [ "${SHOW_SRV}" -eq 1 ] && [ "${DNS1}" != "" -o "${DNS2}" != "" ]; then
|
||||||
|
boot_mesg "Using DNS server(s): ${DNS1} ${DNS2}"
|
||||||
|
boot_mesg_flush
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ case "$2" in
|
|||||||
new)
|
new)
|
||||||
logger -p local0.info -t dhcpcd.exe[$$] "${INTERFACE} has been configured with new IP=${IPADDR}"
|
logger -p local0.info -t dhcpcd.exe[$$] "${INTERFACE} has been configured with new IP=${IPADDR}"
|
||||||
[ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
|
[ -e "/var/ipfire/red/active" ] || touch /var/ipfire/red/active
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
down)
|
down)
|
||||||
logger -p local0.info -t dhcpcd.exe[$$] "${INTERFACE} has been brought down"
|
logger -p local0.info -t dhcpcd.exe[$$] "${INTERFACE} has been brought down"
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ case "${1}" in
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
|
||||||
for i in $( ls -v ${rc_base}/init.d/networking/red.down/* 2> /dev/null); do
|
for i in $( ls -v ${rc_base}/init.d/networking/red.down/* 2> /dev/null); do
|
||||||
check_script_status
|
check_script_status
|
||||||
OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
|
OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
|
||||||
|
|||||||
Reference in New Issue
Block a user