Skip to content
Permalink
Browse files

Finalize nems-tv

  • Loading branch information...
NEMS Linux
NEMS Linux committed Jul 25, 2019
1 parent 7f50a0d commit a1c9874f745ee999964dc177b92a7fe3017940e8
Showing with 51 additions and 0 deletions.
  1. +22 −0 fixes.sh
  2. +29 −0 update.sh
@@ -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/
@@ -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

0 comments on commit a1c9874

Please sign in to comment.
You can’t perform that action at this time.