Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

schedule_sat.sh 1.4 KiB

6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
6 lat temu
12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. PREDICTION_START=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" | head -1)
  3. PREDICTION_END=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" | tail -1)
  4. var2=$(echo "$PREDICTION_END" | cut -d " " -f 1)
  5. MAXELEV=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" | awk -v max=0 '{if($5>max){max=$5}}END{print max}')
  6. while [ "$(date --date="@${var2}" +%D)" == "$(date +%D)" ]; do
  7. START_TIME=$(echo "$PREDICTION_START" | cut -d " " -f 3-4)
  8. var1=$(echo "$PREDICTION_START" | cut -d " " -f 1)
  9. var3=$(echo "$START_TIME" | cut -d " " -f 2 | cut -d ":" -f 3)
  10. TIMER=$("${var2}" - "${var1}" + "${var3}")
  11. OUTDATE=$(date --date="TZ=\"UTC\" '${START_TIME}'" +%Y%m%d-%H%M%S)
  12. if [ "${MAXELEV}" -gt 19 ]
  13. then
  14. echo "${1//" "}""${OUTDATE}" "$MAXELEV"
  15. echo "/home/pi/receive.sh \"${1}\" $2 '${1//" "}'${OUTDATE} /home/pi/predict/weather.tle ${var1} '${TIMER}'" | at "$(date --date="TZ=\"UTC\" '${START_TIME}'" +"%H:%M %D")"
  16. fi
  17. nextpredict=$("${var2}" + 60)
  18. PREDICTION_START=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" "${nextpredict}" | head -1)
  19. PREDICTION_END=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" "${nextpredict}" | tail -1)
  20. MAXELEV=$(/usr/bin/predict -t /home/pi/predict/weather.tle -p "${1}" "${nextpredict}" | awk -v max=0 '{if($5>max){max=$5}}END{print max}')
  21. var2=$(echo "${PREDICTION_END}" | cut -d " " -f 1)
  22. done