From 77c622d2967b91930de860aaa853c007558d5425 Mon Sep 17 00:00:00 2001 From: Nico Rey Date: Wed, 1 Apr 2020 19:43:50 -0300 Subject: [PATCH] ask for lat/lon setup, install bc --- install.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f33a015..34d3cf7 100755 --- a/install.sh +++ b/install.sh @@ -43,6 +43,7 @@ sudo apt install -yq predict \ libusb-1.0 \ sox \ at \ + bc \ nginx \ libncurses5-dev \ libncursesw5-dev \ @@ -97,7 +98,7 @@ fi if [ -e "$HOME/.noaa.conf" ]; then log_done "$HOME/.noaa.conf already exists" else - cp ".noaa.conf" "$HOME/.noaa.conf" + cp "noaa.conf" "$HOME/.noaa.conf" log_done "$HOME/.noaa.conf installed" fi @@ -108,6 +109,13 @@ else log_done "$HOME/.predict/predict.qth installed" fi +if [ -e "$HOME/.wxtoimgrc" ]; then + log_done "$HOME/.wxtoimgrc already exists" +else + cp "wxtoimgrc" "$HOME/.wxtoimgrc" + log_done "$HOME/.wxtoimgrc installed" +fi + ### Install meteor_demod if [ -e /usr/bin/meteor_demod ]; then log_done "meteor_demod was already installed" @@ -173,7 +181,21 @@ sudo chmod 777 /var/ramfs success "Install (almost) done! Let's do some configuration" echo " - 1. Edit $HOME/.noaa.conf - 2. Edit $HOME/.predict/predict.qth and set lat/lon data - 3. Edit sun.py and set lat/lon data + It's time to configure your ground station + You'll be asked for your latitude and longitude + Use negative values for South and West " + +read -rp "Enter your latitude (South values are negative): " + lat=$REPLY + +read -rp "Enter your longitude (West values are negative): " + lon=$REPLY + +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.noaa.conf" +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.wxtoimgrc" +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/$(echo "$lon * -1" | bc)/g" "$HOME/.predict/predict.qth" +sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "sun.py" + + +success "Install done! Double check your $HOME/.noaa.conf settings"