blob: b5ffb411d02f2bbc7c3cc8eee0ba9f60057cdbce [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh /etc/rc.common
2
3START=60
4
5lease_file=/var/dhclient.leases
6config_file=/etc/dhclient.conf
7pid_file=/var/run/dhclient.pid
8script_file=/usr/sbin/dhclient-script
9
10start() {
11 /usr/sbin/dhclient -q -nw -cf $config_file -lf $lease_file -pf $pid_file -sf $script_file `/sbin/uci get network.wan.ifname`
12
13 if [ $? -ne 0 ]; then
14 return 1
15 fi
16}
17
18stop() {
19 if [ ! -e $pid_file ]; then
20 return 1
21 fi
22
23 kill -9 `cat $pid_file`
24
25 if [ $? -ne 0 ]; then
26 return 1
27 fi
28
29 rm $pid_file
30}