#!/bin/sh

if [ -e /dev/mmcblk0p1 ]; then

    SD=/dev/mmcblk0p1

elif [ -e /dev/mmcblk1p1 ]; then

    SD=/dev/mmcblk1p1

else

    echo "/dev/mmcblk0p1 not found."
    echo "/dev/mmcblk1p1 not found."
    exit

fi

echo mount $SD
mount -o ro $SD /mnt

# overwrite nethelper.sh
if [ -f /mnt/Net/nethelper.sh ]; then
    cp /mnt/Net/nethelper.sh /root
    chmod a+x /root/nethelper.sh
fi

if [ -f /mnt/Net/network.sh ]; then

    cp /mnt/Net/network.sh /root
    chmod a+x /root/network.sh
    /root/network.sh

else
    echo "network.sh not found."
fi

echo umount $SD
umount /mnt

# EOF #
