many AVM devices do not have RESET/WPS buttons. So use the otherwise unused DECT/PHONE button to boot the device into setup mode. This patch allows to enter the setup-mode by pressing the phone button (often labeled as DECT) in addition to WPS and reset button. This patch is necessary to allow supporting boards without a WPS and reset button (e.g. AVM FRITZ!Box 7312).
		
			
				
	
	
		
			30 lines
		
	
	
		
			464 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			464 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
 | 
						|
wait=3
 | 
						|
 | 
						|
 | 
						|
wait_setup_mode() {
 | 
						|
	sleep $wait
 | 
						|
	uci set 'gluon-setup-mode.@setup_mode[0].enabled=1'
 | 
						|
	uci commit gluon-setup-mode
 | 
						|
	reboot
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
if [ "$BUTTON" = wps -o "$BUTTON" = reset -o "$BUTTON" = phone ]; then
 | 
						|
	case "$ACTION" in
 | 
						|
		pressed)
 | 
						|
			wait_setup_mode &
 | 
						|
			PID=$!
 | 
						|
			echo $PID > /tmp/.wait_setup_mode
 | 
						|
			;;
 | 
						|
		released)
 | 
						|
			if [ -r /tmp/.wait_setup_mode ]; then
 | 
						|
				kill $(cat /tmp/.wait_setup_mode)
 | 
						|
				rm /tmp/.wait_setup_mode
 | 
						|
			fi
 | 
						|
			;;
 | 
						|
	esac
 | 
						|
fi
 |