@@ -28,6 +28,11 @@ success() { | |||||
echo "${GREEN}$1${RESET}" | echo "${GREEN}$1${RESET}" | ||||
} | } | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
die "This script shouldn't be run as root." | |||||
fi | |||||
### Verify cloned repo | ### Verify cloned repo | ||||
if [ ! -e "$HOME/raspberry-noaa" ]; then | if [ ! -e "$HOME/raspberry-noaa" ]; then | ||||
die "Is https://github.com/reynico/raspberry-noaa cloned in your home directory?" | die "Is https://github.com/reynico/raspberry-noaa cloned in your home directory?" | ||||
@@ -245,11 +250,6 @@ echo " | |||||
set +e | set +e | ||||
### Fix permissions on audio/meteor/images folder | |||||
sudo chmod -R 775 /var/www/wx/audio/ | |||||
sudo chmod -R 775 /var/www/wx/images/ | |||||
sudo chmod -R 775 /var/www/wx/meteor/ | |||||
### Running WXTOIMG to have the user accept the licensing agreement | ### Running WXTOIMG to have the user accept the licensing agreement | ||||
wxtoimg | wxtoimg | ||||
@@ -1,5 +1,11 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$HOME/.tweepy.conf" | . "$HOME/.tweepy.conf" | ||||
@@ -1,5 +1,10 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
@@ -1,11 +1,16 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$HOME/.tweepy.conf" | . "$HOME/.tweepy.conf" | ||||
. "$NOAA_HOME/common.sh" | . "$NOAA_HOME/common.sh" | ||||
SYSTEM_MEMORY=$(free -m | awk '/^Mem:/{print $2}') | SYSTEM_MEMORY=$(free -m | awk '/^Mem:/{print $2}') | ||||
if [ "$SYSTEM_MEMORY" -lt 2000 ]; then | if [ "$SYSTEM_MEMORY" -lt 2000 ]; then | ||||
log "The system doesn't have enough space to store a Meteor pass on RAM" "INFO" | log "The system doesn't have enough space to store a Meteor pass on RAM" "INFO" | ||||
@@ -1,9 +1,20 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$NOAA_HOME/common.sh" | . "$NOAA_HOME/common.sh" | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
die "This script shouldn't be run as root." | |||||
fi | |||||
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 | ||||
grep "NOAA 15" "${NOAA_HOME}"/predict/weather.txt -A 2 > "${NOAA_HOME}"/predict/weather.tle | grep "NOAA 15" "${NOAA_HOME}"/predict/weather.txt -A 2 > "${NOAA_HOME}"/predict/weather.tle | ||||
@@ -1,7 +1,10 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
## debug | |||||
# set -x | |||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
@@ -1,5 +1,11 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$NOAA_HOME/common.sh" | . "$NOAA_HOME/common.sh" | ||||
@@ -1,5 +1,11 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$NOAA_HOME/common.sh" | . "$NOAA_HOME/common.sh" | ||||
@@ -1,5 +1,11 @@ | |||||
#!/bin/bash | #!/bin/bash | ||||
### Run as a normal user | |||||
if [ $EUID -eq 0 ]; then | |||||
echo "This script shouldn't be run as root." | |||||
exit 1 | |||||
fi | |||||
## import common lib | ## import common lib | ||||
. "$HOME/.noaa.conf" | . "$HOME/.noaa.conf" | ||||
. "$NOAA_HOME/common.sh" | . "$NOAA_HOME/common.sh" | ||||