#! /bin/sh

THIS=`basename $0`

tty >/dev/null 2>&1 || exec >/dev/console 2>&1

echo "$THIS: Starting fake firmware update - re-enable modbus snmp, ftp, http, ntp and ssh"

# Reactivate snmp and modbus
rm -f /home/system/nosnmp
rm -f /home/system/nomodbus

# Reactivate ftp, http and ssh
ln -fs /etc/init.d/proftpd /etc/rc.d/S91proftpd
ln -fs /etc/init.d/lighttpd /etc/rc.d/S91lighttpd
ln -fs /etc/init.d/dropbear /etc/rc.d/S16dropbear
ln -fs /etc/init.d/ntp-server /etc/rc.d/S05ntp-server

echo "AMG MODE DISABLED!"


sync
# normally we restart the system, but on manual start switch off blinking
[ -z "$1" ] && reboot || killall iotest
