ardupilot/mk/PX4/ROMFS/init.d/rc.APM

49 lines
856 B
Plaintext
Raw Normal View History

2013-01-20 17:21:44 -04:00
#!nsh
# APM startup script for NuttX on PX4
# To disable APM startup add a /fs/microsd/APM/nostart file
# check for an old file called APM, caused by
# a bug in an earlier firmware release
if [ -f /fs/microsd/APM ]
then
echo "APM file found - renaming"
mv /fs/microsd/APM /fs/microsd/APM.old
fi
if [ -f /fs/microsd/APM/nostart ]
then
echo "APM/nostart found - skipping APM startup"
sh /etc/init.d/rc.error
fi
2013-01-20 17:21:44 -04:00
set sketch NONE
2014-01-13 21:41:07 -04:00
if rm /fs/microsd/APM/boot.log
then
echo "removed old boot.log"
2014-01-13 21:41:07 -04:00
fi
2014-01-13 00:04:42 -04:00
set logfile /fs/microsd/APM/BOOT.LOG
2013-01-20 17:21:44 -04:00
2013-08-05 22:27:34 -03:00
if mkdir /fs/microsd/APM > /dev/null
2013-01-20 17:21:44 -04:00
then
echo "Created APM directory"
fi
if uorb start
then
echo "uorb started OK"
else
sh /etc/init.d/rc.error
fi
2016-11-02 23:13:13 -03:00
echo Starting ArduPilot
if ArduPilot start
then
echo ArduPilot started OK
2013-01-20 17:21:44 -04:00
else
sh /etc/init.d/rc.error
fi
echo "rc.APM finished"