#!/usr/bin/luaweb

local omg = require("omg")
local ost = omg.getOsType()

os.execute("omgstopall")
os.execute("if [ -e /data/config.lua ]; then rm /data/config.lua;fi")
os.execute("if [ -e /data/config.cfg ]; then rm /data/config.cfg;fi")
os.execute("for i in $(seq 1 10);do if [ -e /data/config.cfg.${i} ]; then rm /data/config.cfg.${i};fi;done")
os.execute("echo IP_DHCPMODE=CLIENT >/data/eeprom")
os.execute("cat /dev/null > ~/.bash_history && history -c && poweoff")
