Skip to content

Commit

Permalink
Finalize nems-tv
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Jul 25, 2019
1 parent 7f50a0d commit a1c9874
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
22 changes: 22 additions & 0 deletions fixes.sh
Expand Up @@ -301,6 +301,28 @@ fi

if (( $(awk 'BEGIN {print ("'$ver'" >= "'1.5'")}') )); then

# Move NEMS TV Dashboard out of nems-www
if [[ ! -d /var/www/nems-tv ]]; then
cd /var/www
# Obtain nems-tv
git clone https://github.com/Cat5TV/nems-tv
# If the clone was successful, enable nems-tv
if [[ -d /var/www/nems-tv ]]; then
# Add the apache2 conf
cp -f /var/www/nems-tv/nems-tv.conf /etc/apache2/conf-available/
# Set permissions
chown -R www-data:www-data /var/www/nems-tv
chown root:root /etc/apache2/conf-available/nems-tv.conf
# Update nems-www to remove the /tv folder
cd /var/www/html
git pull
# Enable nems-tv
a2enconf nems-tv
# Reload apache2
/usr/bin/systemctl reload apache2
fi
fi

# Upgrade check_speedtest
if ! grep -q "NEMS00001" /usr/local/nagios/libexec/check_speedtest-cli.sh; then
cp /root/nems/nems-migrator/data/1.5/nagios/plugins/check_speedtest-cli.sh /usr/local/nagios/libexec/
Expand Down
29 changes: 29 additions & 0 deletions update.sh
Expand Up @@ -98,6 +98,35 @@ else
echo " New Commit: $commit"
fi

# Update nems-tv
echo " - nems-tv... "
cd /var/www/nems-tv
commit=`git rev-parse HEAD`
echo " Commit: $commit"
printf " "
result=`git pull`
echo $result
if [[ $result =~ 'error:' ]]; then
echo 'Error detected. Reinstalling...';
mv /var/www/nems-tv /var/www/nems-tv~
cd /var/www
git clone https://github.com/Cat5TV/nems-tv
if [[ -d /var/www/nems-tv ]]; then
chown -R www-data:www-data nems-tv
echo 'Successfully reinstalled.'
rm -rf /var/www/nems-tv~
else
echo 'Reinstall failed. Please copy your backup.nems file and re-image your device.'
mv /var/www/nems-tv~ /var/www/nems-tv
fi
fi
commitnew=`git rev-parse HEAD`
if [[ $commit == $commitnew ]]; then
echo " No changes."
else
echo " New Commit: $commit"
fi

# Update nems-admin
echo " - nems-admin... "
cd /root/nems/nems-admin
Expand Down

0 comments on commit a1c9874

Please sign in to comment.