#!/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

if [ -f /mnt/start-sub.sh ]; then

    cp /mnt/start-sub.sh /tmp
    chmod a+x /tmp/start-sub.sh
    /tmp/start-sub.sh

else
    echo "start-sub.sh not found."
fi

echo umount $SD
umount /mnt

# EOF #
