diff --git a/install.sh b/install.sh index 34d3cf7..7ea7c08 100755 --- a/install.sh +++ b/install.sh @@ -60,7 +60,7 @@ log_done "Packages installed" if [ -e /etc/modprobe.d/rtlsdr.conf ]; then log_done "DVB modules were already blacklisted" else - sudo cp modprobe.d/rtlsdr.conf /etc/modprobe.d/rtlsdr.conf + sudo cp templates/modprobe.d/rtlsdr.conf /etc/modprobe.d/rtlsdr.conf log_done "DVB modules are blacklisted now" fi @@ -90,7 +90,7 @@ if [ -e /usr/local/bin/xwxtoimg ]; then log_done "WxToIMG was already installed" else log_running "Installing WxToIMG..." - sudo dpkg -i wxtoimg-armhf-2.11.2-beta.deb + sudo dpkg -i software/wxtoimg-armhf-2.11.2-beta.deb log_done "WxToIMG installed" fi @@ -98,21 +98,21 @@ fi if [ -e "$HOME/.noaa.conf" ]; then log_done "$HOME/.noaa.conf already exists" else - cp "noaa.conf" "$HOME/.noaa.conf" + cp "templates/noaa.conf" "$HOME/.noaa.conf" log_done "$HOME/.noaa.conf installed" fi if [ -e "$HOME/.predict/predict.qth" ]; then log_done "$HOME/.predict/predict.qth already exists" else - cp "predict.qth" "$HOME/.predict/predict.qth" + cp "templates/predict.qth" "$HOME/.predict/predict.qth" log_done "$HOME/.predict/predict.qth installed" fi if [ -e "$HOME/.wxtoimgrc" ]; then log_done "$HOME/.wxtoimgrc already exists" else - cp "wxtoimgrc" "$HOME/.wxtoimgrc" + cp "templates/wxtoimgrc" "$HOME/.wxtoimgrc" log_done "$HOME/.wxtoimgrc installed" fi @@ -136,7 +136,7 @@ if [ -e /usr/bin/medet_arm ]; then log_done "medet_arm was already installed" else log_running "Installing medet_arm..." - sudo cp medet_arm /usr/bin/medet_arm + sudo cp software/medet_arm /usr/bin/medet_arm sudo chmod +x /usr/bin/medet_arm log_done "medet_arm installed" fi @@ -152,7 +152,7 @@ fi ### Setup Nginx log_running "Setting up Nginx..." -sudo cp nginx.cfg /etc/nginx/sites-enabled/default +sudo cp templates/nginx.cfg /etc/nginx/sites-enabled/default ( sudo mkdir -p /var/www/wx sudo chown -R www-data:www-data /var/www/wx @@ -161,7 +161,7 @@ sudo cp nginx.cfg /etc/nginx/sites-enabled/default ) sudo systemctl restart nginx if [ ! -e /var/www/wx/index.html ]; then - cp index.html /var/www/wx/index.html + cp templates/index.html /var/www/wx/index.html fi log_done "Nginx configured" @@ -171,7 +171,7 @@ if [ $? -eq 0 ]; then log_done "ramfs already setup" else sudo mkdir -p /var/ramfs - cat fstab | sudo tee -a /etc/fstab > /dev/null + cat templates/fstab | sudo tee -a /etc/fstab > /dev/null log_done "Ramfs installed" fi set +e diff --git a/receive.sh b/receive.sh index 811c2f3..36879a8 100755 --- a/receive.sh +++ b/receive.sh @@ -8,7 +8,7 @@ ## pass start timestamp and sun elevation PASS_START=$(expr "$5" + 90) -SUN_ELEV=$(python3 sun.py "$PASS_START") +SUN_ELEV=$(python3 "$NOAA_HOME"/sun.py "$PASS_START") if pgrep "rtl_fm" > /dev/null then diff --git a/receive_meteor.sh b/receive_meteor.sh index 7bdfb14..35b2e43 100755 --- a/receive_meteor.sh +++ b/receive_meteor.sh @@ -6,7 +6,7 @@ ## pass start timestamp and sun elevation PASS_START=$(expr "$5" + 90) -SUN_ELEV=$(python3 sun.py "$PASS_START") +SUN_ELEV=$(python3 "$NOAA_HOME"/sun.py "$PASS_START") if [ "${SUN_ELEV}" -lt "${SUN_MIN_ELEV}" ]; then log "Sun elev is too low. Meteor IR radiometers are not working" "INFO" diff --git a/medet_arm b/software/medet_arm similarity index 100% rename from medet_arm rename to software/medet_arm diff --git a/wxtoimg-armhf-2.11.2-beta.deb b/software/wxtoimg-armhf-2.11.2-beta.deb similarity index 100% rename from wxtoimg-armhf-2.11.2-beta.deb rename to software/wxtoimg-armhf-2.11.2-beta.deb diff --git a/fstab b/templates/fstab similarity index 100% rename from fstab rename to templates/fstab diff --git a/index.html b/templates/index.html similarity index 100% rename from index.html rename to templates/index.html diff --git a/modprobe.d/rtlsdr.conf b/templates/modprobe.d/rtlsdr.conf similarity index 100% rename from modprobe.d/rtlsdr.conf rename to templates/modprobe.d/rtlsdr.conf diff --git a/nginx.cfg b/templates/nginx.cfg similarity index 100% rename from nginx.cfg rename to templates/nginx.cfg diff --git a/noaa.conf b/templates/noaa.conf similarity index 84% rename from noaa.conf rename to templates/noaa.conf index d6aa49d..e746385 100644 --- a/noaa.conf +++ b/templates/noaa.conf @@ -1,4 +1,4 @@ -NOAA_HOME=/home/pi +NOAA_HOME=/home/pi/raspberry-noaa NOAA_OUTPUT=/var/www/wx METEOR_OUTPUT=/var/www/wx/meteor NOAA_AUDIO=/var/ramfs diff --git a/predict.qth b/templates/predict.qth similarity index 100% rename from predict.qth rename to templates/predict.qth diff --git a/wxtoimgrc b/templates/wxtoimgrc similarity index 100% rename from wxtoimgrc rename to templates/wxtoimgrc