/[vps]/baselayout-vserver/branches/baselayout-1_12/net-scripts/net/dhcpcd.sh
Gentoo

Diff of /baselayout-vserver/branches/baselayout-1_12/net-scripts/net/dhcpcd.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 413 Revision 414
21 21
22# bool dhcpcd_check_installed(void) 22# bool dhcpcd_check_installed(void)
23# 23#
24# Returns 1 if dhcpcd is installed, otherwise 0 24# Returns 1 if dhcpcd is installed, otherwise 0
25dhcpcd_check_installed() { 25dhcpcd_check_installed() {
26 if [[ -x /sbin/dhcpcd ]]; then 26 [[ -x /sbin/dhcpcd ]] && return 0
27 if dhcpcd -h 2>&1 | grep -q "etcDir" ; then
28 return 0
29 else
30 ${1:-false} && eerror "We require dhcpcd-2.0.0 or newer"
31 return 1
32 fi
33 fi
34
35 ${1:-false} && eerror "For DHCP (dhcpcd) support, emerge net-misc/dhcpcd" 27 ${1:-false} && eerror "For DHCP (dhcpcd) support, emerge net-misc/dhcpcd"
36 return 1 28 return 1
37} 29}
38 30
39# bool dhcpcd_stop(char *iface) 31# bool dhcpcd_stop(char *iface)
91 local hname=$(hostname) 83 local hname=$(hostname)
92 [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ 84 [[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \
93 && opts="-h \"${hname}\" ${opts}" 85 && opts="-h \"${hname}\" ${opts}"
94 fi 86 fi
95 87
96 # Stop dhcpcd from bringing the interface down when we exit
97 opts="${opts} -o"
98
99 # Add our route metric 88 # Add our route metric
100 metric="metric_${ifvar}" 89 metric="metric_${ifvar}"
101 [[ -n ${!metric} && ${!metric} != "0" ]] && opts="${opts} -m ${!metric}" 90 [[ -n ${!metric} && ${!metric} != "0" ]] && opts="${opts} -m ${!metric}"
102 91
103 # Bring up DHCP for this interface (or alias) 92 # Bring up DHCP for this interface (or alias)

Legend:
Removed from v.413  
changed lines
  Added in v.414

  ViewVC Help
Powered by ViewVC 1.1.20