diff options
author | Christian Heim <phreak@gentoo.org> | 2005-12-06 12:28:25 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2005-12-06 12:28:25 +0000 |
commit | f62636483b16222c394fa17c635d74017cf215ba (patch) | |
tree | 22039adb2bfc850dd02b1a2508f5f0c975b56f91 /net-scripts | |
parent | fix openvz /proc handling; cleanup (diff) | |
download | baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.tar.gz baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.tar.bz2 baselayout-vserver-f62636483b16222c394fa17c635d74017cf215ba.zip |
Importing latest baselayout/trunk changes. Merging revision 1773.
svn path=/baselayout-vserver/trunk/; revision=160
Diffstat (limited to 'net-scripts')
-rw-r--r-- | net-scripts/conf.d/net.example | 5 | ||||
-rw-r--r-- | net-scripts/net.modules.d/dhclient | 10 | ||||
-rw-r--r-- | net-scripts/net.modules.d/dhcpcd | 18 | ||||
-rwxr-xr-x | net-scripts/net.modules.d/helpers.d/dhcp | 11 | ||||
-rwxr-xr-x | net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper | 4 | ||||
-rw-r--r-- | net-scripts/net.modules.d/pump | 9 | ||||
-rw-r--r-- | net-scripts/net.modules.d/udhcpc | 8 |
7 files changed, 43 insertions, 22 deletions
diff --git a/net-scripts/conf.d/net.example b/net-scripts/conf.d/net.example index 77482b7..ec6e056 100644 --- a/net-scripts/conf.d/net.example +++ b/net-scripts/conf.d/net.example @@ -358,6 +358,9 @@ #cd /etc/init.d #ln -s net.lo net.ppp0 # +# We have to instruct ppp0 to actually use ppp +#config_ppp0=( "ppp" ) +# # Each PPP interface requires an interface to use as a "Link" #link_ppp0="/dev/ttyS0" # Most PPP links will use a serial port #link_ppp0="eth0" # PPPoE requires an ethernet interface @@ -387,7 +390,7 @@ # "debug" # Enables syslog debugging # "noauth" # Do not require the peer to authenticate itself # "defaultroute" # Make this PPP interface the default route -# "userpeerdns" # Use the DNS settings provided by PPP +# "usepeerdns" # Use the DNS settings provided by PPP # # On demand options # "demand" # Enable dial on demand diff --git a/net-scripts/net.modules.d/dhclient b/net-scripts/net.modules.d/dhclient index 37861b0..25e8d85 100644 --- a/net-scripts/net.modules.d/dhclient +++ b/net-scripts/net.modules.d/dhclient @@ -45,10 +45,12 @@ dhclient_stop() { local pid=$( < "${pidfile}" ) local ifvar=$( bash_variable "${iface}" ) - d="dhcp_${ifvar}[@]" + d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " ebegin "Stopping dhclient on ${iface}" - if [[ " ${!d} " == *" release "* ]]; then + if [[ ${d} == *" release "* ]]; then local r=$( dhclient -q -r -pf "${pidfile}" \ -sf "${MODULES_DIR}/helpers.d/dhclient-wrapper" "${iface}" ) [[ ${r} == "deconfig" ]] @@ -115,9 +117,11 @@ dhclient_start() { fi d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " # Send our hostname by editing cffile - if ${edit} && [[ -e ${cffile} && " ${!d} " != *" nosendhost "* ]] ; then + if ${edit} && [[ -e ${cffile} && ${d} != *" nosendhost "* ]] ; then local hname=$( hostname ) if [[ ${hname} != "(none)" && ${hname} != "localhost" ]]; then sed -i '/^[ \t]*send[ \t]*host-name[ \t]*/d' "${cffile}" diff --git a/net-scripts/net.modules.d/dhcpcd b/net-scripts/net.modules.d/dhcpcd index 9d8aa14..70a6bcc 100644 --- a/net-scripts/net.modules.d/dhcpcd +++ b/net-scripts/net.modules.d/dhcpcd @@ -52,7 +52,7 @@ dhcpcd_get_vars() { # Returns 0 (true) when a DHCP address dropped # otherwise return 1 dhcpcd_stop() { - local iface=$1 count signal pidfile="/var/run/dhcpcd-$1.pid" opts + local iface=$1 count signal pidfile="/var/run/dhcpcd-$1.pid" d [[ ! -f ${pidfile} ]] && return 0 @@ -60,9 +60,11 @@ dhcpcd_stop() { local pid=$( < "${pidfile}" ) local ifvar=$( bash_variable "${iface}" ) - opts="dhcp_${ifvar}" + d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!opts} " == *" release "* ]]; then + if [[ ${d} == *" release "* ]]; then signal="HUP" else signal="TERM" @@ -91,10 +93,12 @@ dhcpcd_start() { # Map some generic options to dhcpcd d="dhcp_${ifvar}" - [[ " ${d} " == *" nodns "* ]] && opts="${opts} -R" - [[ " ${d} " == *" nontp "* ]] && opts="${opts} -N" - [[ " ${d} " == *" nonis "* ]] && opts="${opts} -Y" - [[ " ${d} " == *" nogateway "* ]] && opts="${opts} -G" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " + [[ ${d} == *" nodns "* ]] && opts="${opts} -R" + [[ ${d} == *" nontp "* ]] && opts="${opts} -N" + [[ ${d} == *" nonis "* ]] && opts="${opts} -Y" + [[ ${d} == *" nogateway "* ]] && opts="${opts} -G" # We transmit the hostname by default:q if [[ " ${d} " != *" nosendhost "* && " ${opts} " != *" -h "* ]]; then diff --git a/net-scripts/net.modules.d/helpers.d/dhcp b/net-scripts/net.modules.d/helpers.d/dhcp index bfde3b1..52998ca 100755 --- a/net-scripts/net.modules.d/helpers.d/dhcp +++ b/net-scripts/net.modules.d/helpers.d/dhcp @@ -92,8 +92,11 @@ echo "${ip}" > "/var/cache/dhcp-${interface}.lease" chmod 600 "/var/cache/dhcp-${interface}.lease" d="dhcp_${ifvar}" +d=" ${!d} " +[[ ${d} == " " ]] && d=" ${dhcp} " + # Configure our default route - we only have 1 default route -if [[ " ${!d} " != *" nogateway "* ]]; then +if [[ ${d} != *" nogateway "* ]]; then for r in ${routers}; do interface_default_route "${interface}" "${r}" "${metric:-0}" && break done @@ -110,9 +113,9 @@ fi # Only setup the information we're told to # By default that's everything -[[ " ${!d} " != *" nodns "* ]] && system_dns "${interface}" -[[ " ${!d} " != *" nontp "* ]] && system_ntp "${interface}" -[[ " ${!d} " != *" nonis "* ]] && system_nis "${interface}" +[[ ${d} != *" nodns "* ]] && system_dns "${interface}" +[[ ${d} != *" nontp "* ]] && system_ntp "${interface}" +[[ ${d} != *" nonis "* ]] && system_nis "${interface}" if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then best_interface=$( select_best_interface ) diff --git a/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper b/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper index 4b4774f..f5e5a9c 100755 --- a/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper +++ b/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper @@ -31,9 +31,11 @@ ifvar=$( bash_variable "${interface}" ) if [[ ${action} == "up" ]]; then d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " resolv="${statedir}/${interface}/resolv.conf" - if [[ " ${!d} " != *" nodns "* ]]; then + if [[ ${d} != *" nodns "* ]]; then search="dns_search_${ifvar}" if [[ -n ${!search} ]]; then tmp="${resolv}.$$" diff --git a/net-scripts/net.modules.d/pump b/net-scripts/net.modules.d/pump index bb8be39..5c81b2c 100644 --- a/net-scripts/net.modules.d/pump +++ b/net-scripts/net.modules.d/pump @@ -67,10 +67,11 @@ pump_start() { # Map some generic options to pump d="dhcp_${ifvar}" - [[ " ${!d} " == " " ]] && d=" ${dhcp} " - [[ " ${!d} " == *" nodns "* ]] && opts="${opts} --no-dns" - [[ " ${!d} " == *" nogateway "* ]] && opts="${opts} --no-gateway" - [[ " ${!d} " == *" nontp "* ]] && opts="${opts} --no-ntp" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " + [[ ${d} == *" nodns "* ]] && opts="${opts} --no-dns" + [[ ${d} == *" nogateway "* ]] && opts="${opts} --no-gateway" + [[ ${d} == *" nontp "* ]] && opts="${opts} --no-ntp" search="dns_search_${ifvar}" [[ -n ${!search} ]] && opts="${opts} --search-path='"${!search}"'" diff --git a/net-scripts/net.modules.d/udhcpc b/net-scripts/net.modules.d/udhcpc index 69598e3..a0661a0 100644 --- a/net-scripts/net.modules.d/udhcpc +++ b/net-scripts/net.modules.d/udhcpc @@ -43,8 +43,10 @@ udhcpc_stop() { local ifvar=$( bash_variable "${iface}" ) d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!d} " == *" release "* ]]; then + if [[ ${d} == *" release "* ]]; then kill -s USR2 "${pid}" &>/dev/null [[ -f "/var/cache/dhcp-${iface}.lease" ]] \ && rm "/var/cache/dhcp-${iface}.lease" @@ -75,8 +77,10 @@ udhcpc_start() { opts="${!opts}" d="dhcp_${ifvar}" + d=" ${!d} " + [[ ${d} == " " ]] && d=" ${dhcp} " - if [[ " ${!d} " != *" nosendhost "* ]]; then + if [[ " ${d} " != *" nosendhost "* ]]; then if [[ ! " ${opts}" =~ " -([hH] |-hostname=)" ]]; then local hname=$( hostname ) [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ |