12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #!/bin/bash
- . /lib/lsb/init-functions
- . $IFCONFIG
- pidfile="/var/run/dhcpcd-$1.pid"
- case "$2" in
- up)
-
- if ! $(echo ${SERVICE} | grep -q " "); then
- log_info_msg2 "\n"
- fi
-
- log_info_msg "Starting dhcpcd on the $1 interface..."
-
- if [ -f "$pidfile" ]; then
- ps `cat "$pidfile"` | grep dhcpcd > /dev/null
- if [ $? != 0 ]; then
- rm -f /var/run/dhcpcd-$1.pid > /dev/null
-
- else
- log_warning_msg "dhcpcd is already running!"
- exit 2
- fi
- fi
- /sbin/dhcpcd $1 $DHCP_START
- evaluate_retval
- ;;
- down)
- log_info_msg "Stopping dhcpcd on the $1 interface..."
- if [ -z "$DHCP_STOP" ]; then
- killproc -p "${pidfile}" /sbin/dhcpcd
- else
- /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null
- if [ "$?" -eq 1 ]; then
- log_warning_msg "dhcpcd not running!"
- exit 2
- fi
- fi
- evaluate_retval
- ;;
- *)
- echo "Usage: $0 [interface] {up|down}"
- exit 1
- ;;
- esac
|