You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
483 B

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