Bladeren bron

add pd120_decoder install

tags/v1.7
Nico Rey 3 jaren geleden
bovenliggende
commit
819463c184
1 gewijzigde bestanden met toevoegingen van 28 en 11 verwijderingen
  1. +28
    -11
      migrations/20201292-iss.sh

+ 28
- 11
migrations/20201292-iss.sh Bestand weergeven

@@ -10,37 +10,54 @@ fi
## import common lib
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"
STEPS="6"

datetime=$(date +"%Y%m%d-%H%M%S")

log "1/3: Backing up database" "INFO"
log "1/$STEPS: Backing up database" "INFO"
cp "$NOAA_HOME/panel.db" "$NOAA_HOME/panel.db.bak-$datetime"
log "1/3: Database backup done: panel.db.bak-$datetime" "INFO"
log "1/$STEPS: Database backup done: panel.db.bak-$datetime" "INFO"

log "2/3: Creating new columns" "INFO"
log "2/$STEPS: Creating new columns" "INFO"
set +e
sqlite3 "$NOAA_HOME/panel.db" "alter table decoded_passes add column img_count integer;"
sqlite3 "$NOAA_HOME/panel.db" "alter table decoded_passes add column sat_type integer;"
set -e
log "2/3: img_count and sat_type columns created" "INFO"
log "2/$STEPS: img_count and sat_type columns created" "INFO"


log "3/3: Migrating is_noaa column" "INFO"
log "3/$STEPS: Migrating is_noaa column" "INFO"
sqlite3 "$NOAA_HOME/panel.db" "update decoded_passes set sat_type = is_noaa;"
log "3/3: is_noaa column migration done" "INFO"
log "3/$STEPS: is_noaa column migration done" "INFO"


log "4/3: Setting up SCHEDULE_ISS on .noaa.conf" "INFO"
log "4/$STEPS: Setting up SCHEDULE_ISS on .noaa.conf" "INFO"
set +e
if ! grep -q SCHEDULE_ISS "$HOME/.noaa.conf"; then
echo "SCHEDULE_ISS=\"false\"" >> "$HOME/.noaa.conf"
log "4/3: SCHEDULE_ISS is set now on .noaa.conf" "INFO"
log "4/$STEPS: SCHEDULE_ISS is set now on .noaa.conf" "INFO"
else
log "4/3: SCHEDULE_ISS was already set on .noaa.conf" "INFO"
log "4/$STEPS: SCHEDULE_ISS was already set on .noaa.conf" "INFO"
fi
set -e

log "3/3: Updating PHP files" "INFO"
log "5/$STEPS: Updating PHP files" "INFO"
sudo cp "$NOAA_HOME/templates/webpanel/Model/Conn.php" "/var/www/wx/Model/Conn.php"
sudo cp "$NOAA_HOME/templates/webpanel/Views/V_viewLastImages.php" "/var/www/wx/Views/V_viewLastImages.php"
log "3/3: PHP files updated" "INFO"
log "5/$STEPS: PHP files updated" "INFO"


log "6/$STEPS: Installing pd120_decoder" "INFO"
if [ -f "$NOAA_HOME/demod.py" ]; then
log "6/$STEPS: pd120_decoder already installed" "INFO"
else
wget -qr https://github.com/reynico/pd120_decoder/archive/master.zip -O /tmp/master.zip
(
cd /tmp
unzip master.zip
cd pd120_decoder-master/pd120_decoder/
pip3 install --user -r requirements.txt
cp "{demod.py,utils.py}" "$NOAA_HOME"
)
log "6/$STEPS: pd120_decoder installed" "INFO"
fi

Laden…
Annuleren
Opslaan