Browse Source

Standarize library import

tags/v1.3
Nico Rey 4 years ago
parent
commit
40e59a1c09
5 changed files with 9 additions and 8 deletions
  1. +1
    -1
      common.sh
  2. +2
    -1
      prune.sh
  3. +2
    -2
      schedule.sh
  4. +2
    -2
      schedule_meteor.sh
  5. +2
    -2
      schedule_sat.sh

+ 1
- 1
common.sh View File

@@ -3,7 +3,7 @@
## debug ## debug
# set -x # set -x


. ~/.noaa.conf
. "$HOME/.noaa.conf"


declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3) declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)
log_level=${LOG_LEVEL} log_level=${LOG_LEVEL}


+ 2
- 1
prune.sh View File

@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash


## import common lib ## import common lib
. ~/common.sh
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"


find "${NOAA_HOME}/map/" -type f -name '*.png' -mtime +1 -exec rm -f {} \; find "${NOAA_HOME}/map/" -type f -name '*.png' -mtime +1 -exec rm -f {} \;
log "${NOAA_HOME}/map/ folder pruned" "INFO" log "${NOAA_HOME}/map/ folder pruned" "INFO"


+ 2
- 2
schedule.sh View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash


## import common lib ## import common lib
. ~/.noaa.conf
. "${NOAA_HOME}"/common.sh
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"


wget -qr http://www.celestrak.com/NORAD/elements/weather.txt -O "${NOAA_HOME}"/predict/weather.txt wget -qr http://www.celestrak.com/NORAD/elements/weather.txt -O "${NOAA_HOME}"/predict/weather.txt
wget -qr http://www.celestrak.com/NORAD/elements/amateur.txt -O "${NOAA_HOME}"/predict/amateur.txt wget -qr http://www.celestrak.com/NORAD/elements/amateur.txt -O "${NOAA_HOME}"/predict/amateur.txt


+ 2
- 2
schedule_meteor.sh View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash


## import common lib ## import common lib
. ~/.noaa.conf
. "${NOAA_HOME}"/common.sh
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"


PREDICTION_START=$(/usr/bin/predict -t "${NOAA_HOME}"/predict/weather.tle -p "${1}" | head -1) PREDICTION_START=$(/usr/bin/predict -t "${NOAA_HOME}"/predict/weather.tle -p "${1}" | head -1)
PREDICTION_END=$(/usr/bin/predict -t "${NOAA_HOME}"/predict/weather.tle -p "${1}" | tail -1) PREDICTION_END=$(/usr/bin/predict -t "${NOAA_HOME}"/predict/weather.tle -p "${1}" | tail -1)


+ 2
- 2
schedule_sat.sh View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash


## import common lib ## import common lib
. ~/.noaa.conf
. "${NOAA_HOME}"/common.sh
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"


# $1 = Satellite Name # $1 = Satellite Name
# $2 = Frequency # $2 = Frequency


Loading…
Cancel
Save