#!/bin/sh
# 获取接口名称和事件类型
INTERFACE=$1
EVENT=$2
# 检查事件类型
case "$EVENT" in
CONNECTED)
echo "Connected to the network. Attempting to get IP address..."
udhcpc -i $INTERFACE
;;
*)
echo "Received event: $EVENT"
;;
esac
wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf
sleep 3
wpa_cli -a /etc/wpa_event_handler.sh