blob: d04e04cd6fa869e13ac386d0e3fae8d476ef18c3 [file] [log] [blame]
you.chencd882682023-04-24 15:39:37 +08001#!/bin/sh
2
3if [ "$1" == "start" ]; then
4 ifconfig wlan0 up
5 if [ $? != 0 ]; then
6 exit 1
7 fi
you.chen3c309002023-04-26 10:00:06 +08008 ps -eo "%p %a" | grep "dhcpcd wlan0" | grep -v grep
you.chencd882682023-04-24 15:39:37 +08009 if [ $? != 0 ]; then
10 dhcpcd wlan0 -t 0 -o domain_name_servers --noipv4ll -B -G &
11 fi
12elif [ "$1" == "stop" ]; then
you.chen3c309002023-04-26 10:00:06 +080013 ps -eo "%p %a" | grep "dhcpcd wlan0" | grep -v grep | awk '{print "kill "$1}' | sh
you.chencd882682023-04-24 15:39:37 +080014 ifconfig wlan0 0.0.0.0
15 if [ $? != 0 ]; then
16 exit 1
17 fi
18else
19 exit 2
20fi
21
you.chen3c309002023-04-26 10:00:06 +080022exit 0