blob: 5f335202e2dcde2d1a52ed6f113f6c15c5514751 [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
8 ps -ef | grep "dhcpcd wlan0" | grep -v grep
9 if [ $? != 0 ]; then
10 dhcpcd wlan0 -t 0 -o domain_name_servers --noipv4ll -B -G &
11 fi
12elif [ "$1" == "stop" ]; then
13 ps -ef | grep "dhcpcd wlan0" | grep -v grep | awk '{print $2}' | xargs kill
14 ifconfig wlan0 0.0.0.0
15 if [ $? != 0 ]; then
16 exit 1
17 fi
18else
19 exit 2
20fi
21