forked from ossasmaz/UAVcast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDroneStart.sh
More file actions
executable file
·22 lines (21 loc) · 848 Bytes
/
DroneStart.sh
File metadata and controls
executable file
·22 lines (21 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $DIR/./DroneConfig.cfg
source $DIR/script/DroneCode.sh
#Add 15sec checktime to cron.
if [ $DroneCheck == "Yes" ]; then
#write out current crontab
crontab -l > $DIR/mycron
#echo new cron into cron file
echo "* * * * * /home/pi/UAVcast/script/./DroneCheck.sh > /home/pi/UAVcast/log/cron.log 2>&1" >> mycron
echo "* * * * * sleep 15; /home/pi/UAVcast/script/./DroneCheck.sh >> /home/pi/UAVcast/log/cron.log 2>&1" >> mycron
echo "* * * * * sleep 30; /home/pi/UAVcast/script/./DroneCheck.sh >> /home/pi/UAVcast/log/cron.log 2>&1" >> mycron
echo "* * * * * sleep 45; /home/pi/UAVcast/script/./DroneCheck.sh >> /home/pi/UAVcast/log/cron.log 2>&1" >> mycron
#install new cron file
crontab mycron
rm mycron
else
crontab -r
fi
#Start DroneInit
DroneInit