#!/bin/sh
# Copyright (C) 2008-2010 OpenWrt.org
# add by dzx 

wan_detect_mode="$(uci get wanDetect.settings.mode)"
if [ "$wan_detect_mode" = "test1" ]; then
	if [ "$ACTION" = "released" -a -f "/tmp/wps_pressed" ]; then
		echo 1 > /tmp/button_wps_check
	elif [ "$ACTION" = "pressed" ]; then
		touch /tmp/wps_pressed
	fi
	exit 0
fi

if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
	lua /usr/sbin/wps_button
fi
