1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
openmptcprouter-feeds/qaa/qca/net/qca-hostap/files/wps-extender-hotplug.sh
2022-09-10 05:47:47 +08:00

36 lines
936 B
Bash

#
# Copyright (c) 2017 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
#
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
if [ -r /var/run/son.conf ] ||
[ -r /var/run/son_active ]; then
exit 0
fi
[ -r /var/run/wifi-wps-enhc-extn.conf ] || exit 0
echo "" > /dev/console
echo "WPS PUSH BUTTON EVENT DETECTED" > /dev/console
num=`grep -w "RADIO" /var/run/wifi-wps-enhc-extn.conf | wc -l`
if [ -r /var/run/wifi-wps-enhc-extn.pid ]; then
kill "$(cat "/var/run/wifi-wps-enhc-extn.pid")"
sleep 1
fi
if [ -r /var/run/wifi-wps-enhc-extn.pid ]; then
rm -f /var/run/wifi-wps-enhc-extn.pid
exit 0
fi
echo "START APP TO HANDLE WPS PUSH BUTTON EVENT" > /dev/console
/usr/sbin/wps_enhc -b /var/run/wifi-wps-enhc-extn.pid -n $num \
-d 128 -l /var/run/wifi-wps-enhc-extn.log
fi