diff options
author | 2005-11-05 06:31:33 +0000 | |
---|---|---|
committer | 2005-11-05 06:31:33 +0000 | |
commit | c19e259b2b3334adde61c3db89774b9db41b8704 (patch) | |
tree | d6aa04fd4bd07e9bb83abae6d63f7cb9c7b82c2f /net-scripts/net.modules.d/dhcpcd | |
parent | Merging changes from baselayout 1583 (diff) | |
download | baselayout-vserver-c19e259b2b3334adde61c3db89774b9db41b8704.tar.gz baselayout-vserver-c19e259b2b3334adde61c3db89774b9db41b8704.tar.bz2 baselayout-vserver-c19e259b2b3334adde61c3db89774b9db41b8704.zip |
Merging changes between baselayout r1583 and r1596.
svn path=/baselayout-vserver/trunk/; revision=64
Diffstat (limited to 'net-scripts/net.modules.d/dhcpcd')
-rw-r--r-- | net-scripts/net.modules.d/dhcpcd | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/net-scripts/net.modules.d/dhcpcd b/net-scripts/net.modules.d/dhcpcd index 25e3069..ea50e30 100644 --- a/net-scripts/net.modules.d/dhcpcd +++ b/net-scripts/net.modules.d/dhcpcd @@ -10,18 +10,14 @@ dhcpcd() { LC_ALL=C /sbin/dhcpcd "$@" } -# char* dhcpcd_provides(void) -# -# Returns a string to change module definition for starting up -dhcpcd_provides() { - echo "dhcp" -} - # void dhcpcd_depend(void) # # Sets up the dependancies for the module dhcpcd_depend() { after interface + provide dhcp + functions interface_exists interface_get_address + variables dhcpcd dhcp } # bool dhcpcd_check_installed(void) @@ -41,21 +37,6 @@ dhcpcd_check_installed() { return 1 } -# bool dhcpcd_check_depends(void) -# -# Checks to see if we have the needed functions -dhcpcd_check_depends() { - local f - - for f in interface_exists interface_get_address; do - [[ $( type -t "${f}" ) == "function" ]] && continue - eerror "dhcpcd: missing required function ${f}\n" - return 1 - done - - return 0 -} - # char* dhcpcd_get_vars(char *interface) # # Returns a string spaced with possible user set @@ -73,8 +54,6 @@ dhcpcd_get_vars() { dhcpcd_stop() { local iface=$1 count signal pidfile="/var/run/dhcpcd-$1.pid" d - dhcpcd_check_installed || return 0 - [[ ! -f ${pidfile} ]] && return 0 ebegin "Stopping dhcpcd on ${iface}" @@ -102,7 +81,7 @@ dhcpcd_stop() { # # Returns 0 (true) when a DHCP address is obtained, otherwise 1 dhcpcd_start() { - local iface="$1" opts hostname pidfile="/var/run/dhcpcd-$1.pid" + local iface="$1" opts pidfile="/var/run/dhcpcd-$1.pid" local ifvar=$( bash_variable "${iface}" ) metric d interface_exists "${iface}" true || return 1 @@ -120,10 +99,9 @@ dhcpcd_start() { # We transmit the hostname by default if [[ ${d} != *" nosendhost "* && ${opts} != *" -h "* ]]; then - hostname=$( hostname ) - [[ -n ${hostname} && ${hostname} != "(none)" \ - && ${hostname} != "localhost" ]] \ - && opts="-h \"${hostname}\" ${opts}" + local hname=$( hostname ) + [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ + && opts="-h \"${hname}\" ${opts}" fi # Stop dhcpcd from bringing the interface down when we exit |