source: bootscripts-standard/cblfs/sysconfig/network-devices/services/dhcpcd@ c712058

Last change on this file since c712058 was ad29fe9, checked in by Jim Gifford <clfs@…>, 16 years ago

DHCPCD Update

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[7df280d]1#!/bin/bash
[7125722]2# Begin $network-devices/services/dhcpcd
3
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>
7
8. /etc/sysconfig/rc
9. $rc_functions
10. $IFCONFIG
11
[1d02f01]12pidfile="/var/run/dhcpcd-$1.pid"
[7125722]13
14case "$2" in
15 up)
[ad29fe9]16 boot_mesg -n "Starting DHCPCD on the $1 interface..."
[7125722]17 # Test to see if there is a stale pid file
[1d02f01]18 if [ -f "$pidfile" ]; then
19 ps `cat "$pidfile"` | grep dhcpcd > /dev/null
20 if [ $? != 0 ]; then
21 rm -f $pidfile > /dev/null
[7125722]22 else
23 boot_mesg "dhcpcd already running!" ${WARNING}
24 echo_warning
25 exit 2
26 fi
27 fi
28 /sbin/dhcpcd $1 $DHCP_START
29 # Save the return value
30 RET="$?"
[ad29fe9]31 echo ""
32 $(exit "$RET")
33 evaluate_retval
[7125722]34 ;;
35
36 down)
[ad29fe9]37 boot_mesg -n "Stopping DHCPCD on the $1 interface..."
[1d02f01]38 if [ -z "$DHCP_STOP" ]; then
[7125722]39 echo ""
[1d02f01]40 killproc -p "$pidfile" /sbin/dhcpcd
[7125722]41 else
42 /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null
43 RET="$?"
44 if [ "$RET" -eq 0 ]; then
45 echo ""
46 echo_ok
47 elif [ "$RET" -eq 1 ]; then
48 boot_mesg "dhcpcd not running!" ${WARNING}
49 echo_warning
50 else
51 echo ""
52 echo_failure
53 fi
54 fi
55 ;;
56
57 *)
58 echo "Usage: $0 [interface] {up|down}"
59 exit 1
60 ;;
61esac
62
63# End $network_devices/services/dhcpcd
Note: See TracBrowser for help on using the repository browser.