BEGIN {
	code_ok = RCOK
	code_pw = RCPOWER

	code_reset = code_ok code_pw code_pw code_pw code_pw code_pw code_pw code_pw code_pw
}

{
	s = $8

	if(length(s) == 3 && s != 4 && ! -z ms)
		ms = ms s

	if(s == code_ok)
		ms = code_ok
	if(ms == code_reset)
	{
		if(VFDTYPE == 4)
			system("echo boot > " VFDDEV "; sync; sync; init 6")
		else
			system("echo REBOOT > " VFDDEV "; sync; sync; init 6")
	}
	s = ""

}
