* Fixed problem when BASEDIR paths were given without a trailing '/'.
[linux_from_scratch.git] / bootscripts / blfs / sysconfig / network-devices / services / dhcpcd
blobb14819039464d05354e3d2c1810810da79e8f4c6
1 #!/bin/sh
2 # Begin $network-devices/services/dhcpcd
4 # Based upon lfs-bootscripts-1.12 $network_devices/if{down,up}
5 # Rewritten by Nathan Coulson <nathan@linuxfromscratch.org>
6 # Adapted for dhcpcd by DJ Lucas <dj@lucasit.com>
8 . /etc/sysconfig/rc
9 . $rc_functions
10 . $network_devices/ifconfig.$1
12 case "$2" in
13 up)
14 echo "Bringing up the $1 interface (dhcpcd)..."
15 # Test to see if there is a stale pid file
16 if [ -f /var/run/dhcpcd-$1.pid ]
17 then
18 ps $(cat /var/run/dhcpcd-$1.pid) | grep dhcpcd > /dev/null
19 if [ $? != 0 ]
20 then
21 rm -f /var/run/dhcpcd-$1.pid > /dev/null
22 else
23 print_status warning running
24 exit 2
27 /sbin/dhcpcd $1 $DHCP_START
28 evaluate_retval
31 down)
32 echo "Bringing down the $1 interface (dhcpcd)..."
33 /sbin/dhcpcd $1 $DHCP_STOP
34 evaluate_retval
38 echo "Usage: $0 [interface] {up|down}"
39 exit 1
41 esac
43 # End $network_devices/services/dhcpcd