#!/bin/sh
CONFIG_PATH=/mnt/sdcard/hacks/etc
BIN_PATH=/mnt/sdcard/hacks/bin
chmod -R +x /mnt/sdcard/hacks
chmod -R +x /mnt/sdcard/manu_test
chmod -R +x /mnt/sdcard/www



if [ -f "/usr/bin/mi_rtsp_server" ]; then
    sleep 95 && /./mnt/sdcard/manu_test/manu.sh &
    sleep 98 && httpd -p 80 -h /mnt/sdcard/www -c /mnt/sdcard/www/cgi-bin &
    
else
    if [ -f "$BIN_PATH/mi_rtsp_server" ]; then
        sleep 90 && $BIN_PATH/mi_rtsp_server &
        sleep 95 && /./mnt/sdcard/manu_test/manu.sh &
        sleep 98 && httpd -p 80 -h /mnt/sdcard/www -c /mnt/sdcard/www/cgi-bin &
    else
        sleep 95 && /./mnt/sdcard/manu_test/manu.sh &
        sleep 98 && httpd -p 80 -h /mnt/sdcard/www -c /mnt/sdcard/www/cgi-bin &
    fi
fi
