mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +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
|
||||
. ${rc_functions}
|
||||
|
||||
SHOW_SRV=1
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
boot_mesg "Starting Domain Name Service Proxy..."
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||
ARGS=
|
||||
[ "$DOMAIN_NAME_GREEN" != "" ] && ARGS="-s $DOMAIN_NAME_GREEN "
|
||||
[ -e "/var/ipfire/red/active" ] && ARGS+="-r /var/ipfire/red/resolv.conf"
|
||||
[ "$DOMAIN_NAME_GREEN" != "" ] && ARGS="-s $DOMAIN_NAME_GREEN"
|
||||
|
||||
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
|
||||
|
||||
if [ "${SHOW_SRV}" -eq 1 ] && [ "${DNS1}" != "" -o "${DNS2}" != "" ]; then
|
||||
boot_mesg "Using DNS server(s): ${DNS1} ${DNS2}"
|
||||
boot_mesg_flush
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
@@ -21,7 +21,6 @@ case "$2" in
|
||||
new)
|
||||
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
|
||||
fi
|
||||
;;
|
||||
down)
|
||||
logger -p local0.info -t dhcpcd.exe[$$] "${INTERFACE} has been brought down"
|
||||
|
||||
@@ -278,6 +278,7 @@ case "${1}" in
|
||||
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
|
||||
check_script_status
|
||||
OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
|
||||
|
||||
Reference in New Issue
Block a user