机载第一版

This commit is contained in:
xin
2025-11-19 15:11:44 +08:00
parent 612bf24b15
commit e8db9aa9fe
32 changed files with 766 additions and 75 deletions

View File

@ -5,17 +5,17 @@ do
echo $time
if [[ "$time" > "01:00:01" ]] && [[ "$time" < "22:30:00" ]]
then
ps -ef | grep "TowerOptoSifAndSpectral" | grep -v "grep"
ps -ef | grep "AirOptoSifAndSpectral" | grep -v "grep"
if [ "$?" -eq 1 ]
then
/home/pi/bin/TowerOptoSifAndSpectral &
/home/pi/bin/AirOptoSifAndSpectral &
echo "process has been restarted!" > /home/data/log.txt
else
echo "process already started!"
sleep 60
fi
else
pid=$(ps -ef | grep "TowerOptoSifAndSpectral" | grep -v "grep" | awk '{print $2}')
pid=$(ps -ef | grep "AirOptoSifAndSpectral" | grep -v "grep" | awk '{print $2}')
if [ -z "$pid" ]
then
sleep 60

View File

@ -5,23 +5,23 @@ do
echo $time
if [[ "$time" > "01:00:01" ]] && [[ "$time" < "22:30:00" ]]
then
ps -ef | grep "TemperatureControler" | grep -v "grep"
ps -ef | grep "GPSLog" | grep -v "grep"
if [ "$?" -eq 1 ]
then
/home/pi/bin/TemperatureControler &
/home/pi/bin/GPSLog &
echo "process has been restarted!" > /home/data/log.txt
else
echo "process already started!"
sleep 60
fi
else
pid=$(ps -ef | grep "TemperatureControler" | grep -v "grep" | awk '{print $2}')
pid=$(ps -ef | grep "GPSLog" | grep -v "grep" | awk '{print $2}')
if [ -z "$pid" ]
then
sleep 60
else
echo "$?"
echo "time to kill the task" > /home/data/log.txt
echo "time to kill the task" > /home/data/gpslog.txt
kill "$pid"
fi
fi

View File

@ -8,5 +8,5 @@ chmod +x /root/Mywathdog.sh
chmod +x /root/Mywathdogtemp.sh
bash /root/Mywathdog.sh &
bash /root/Mywathdogtemp.sh &
/home/pi/bin/TemperatureControler > /root/templog.log &
/home/pi/bin/AirOptoSifAndSpectral > /root/templog.log &