#!/bin/sh

# Backup partitions and user data
# cat /dev/mtdblock0 > /home/mtdblock0-boot.img
# cat /dev/mtdblock1 > /home/mtdblock1-kernel.img
# cat /dev/mtdblock2 > /home/mtdblock2-root.img
# cat /dev/mtdblock3 > /home/mtdblock3-usr.img
# cat /dev/mtdblock4 > /home/mtdblock4-custom.img
# cat /dev/mtdblock5 > /home/mtdblock5-mtd.img
# cp -Rf /mnt/mtd /home

# Enable UART 
# armbenv -s xmuart 0	

# Root password
# echo "root:697SJ23Ru0j3M:0:0:root:/:/bin/sh" > /mnt/mtd/Log/ns   # original
echo "root::0:0:root:/:/bin/sh" > /mnt/mtd/Log/ns                  # no password

# Start Telnet server (port 23)
/home/busybox telnetd &                # standard
# /home/busybox telnetd -l /bin/sh &   # no password

# Start main app (Sofia)
/usr/bin/app.sh &

# Start FTP server (port 24)
/home/busybox tcpsvd -vE 0.0.0.0 24 /home/busybox ftpd -w -A / &

# sleep 200000