#!/bin/sh # Sample autorun script cd `dirname $0` # Turn on the red LED [ -f /sys/class/leds/warp-red/brightness ] && echo 1 > /sys/class/leds/warp-red/brightness [ -f cuImage.warp ] && warploader -p kernel cuImage.warp [ -f uRamdisk ] && warploader -p root uRamdisk kill_httpd () { local PS=`ps` if echo $PS | fgrep -q httpd ; then echo "httpd must be shut down" killall httpd sleep 5 PS=`ps` if echo $PS | fgrep -q httpd ; then echo "httpd will not die" killall -9 httpd sleep 5 PS=`ps` if echo $PS | fgrep -q httpd ; then echo "It looks like httpd is a zombie" fi fi fi } unmount_persistent () { if mount | fgrep -q /persistent ; then kill_httpd umount /persistent || { logger "Unable to unmount persistent"; return 1; } fi return 0 } # Persistent is a bit trickier since we must unmount before flashing if [ -f image.jffs2 ] ; then if unmount_persistent ; then warploader -p persistent image.jffs2 fi fi # Turn off red led [ -f /sys/class/leds/warp-red/brightness ] && echo 0 > /sys/class/leds/warp-red/brightness