#!/bin/bash #Called from LinHES Service Menu Updates Available Menu if [[ "$1" = "install" ]] then msg_client.py --msg "Updating...|middle" --timeout 600 --tag "Updating" sudo pacman -Su --force --noconfirm msg_client.py --clear --tag "Updating" msg_client.py --kill msg_client.py --msg "Updates complete.\nReturning to Main Menu.|middle" if grep linux /tmp/to_be_upgraded || grep nvidia /tmp/to_be_upgraded then msg_client.py --msg "Updates require a reboot.|middle" fi else msg_client.py --msg "Updates canceled.|middle" fi sudo rm -fr /tmp/to_be_upgraded if grep -q Updates\ Available /usr/share/mythtv/themes/defaultmenu/linhes.xml then mv /usr/share/mythtv/themes/defaultmenu/linhes.xml /tmp/linhes.xml.tmp sed -e '/\#UpdatesAv/,/\#UpdatesAv/d' < /tmp/linhes.xml.tmp > /usr/share/mythtv/themes/defaultmenu/linhes.xml mv /usr/share/mythtv/themes/defaultmenu/linhes.xml /tmp grep -va '/mythmenu' /tmp/linhes.xml > /tmp/linhes.xml.tmp echo "" >> /tmp/linhes.xml.tmp echo " " >> /tmp/linhes.xml.tmp echo "" >> /tmp/linhes.xml.tmp echo "" >> /tmp/linhes.xml.tmp echo "" >> /tmp/linhes.xml.tmp mv /tmp/linhes.xml.tmp /usr/share/mythtv/themes/defaultmenu/linhes.xml fi #hide LinHES update message on main menu sudo sed -i '/LinHES UPDATE MESSAGE/c\