diff options
Diffstat (limited to 'abs/core/linhes-scripts/linhes_update.sh')
-rw-r--r-- | abs/core/linhes-scripts/linhes_update.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/abs/core/linhes-scripts/linhes_update.sh b/abs/core/linhes-scripts/linhes_update.sh new file mode 100644 index 0000000..3b455e0 --- /dev/null +++ b/abs/core/linhes-scripts/linhes_update.sh @@ -0,0 +1,38 @@ +#!/bin/bash +dsply () { + if grep -q Updates\ Available /usr/share/mythtv/linhes.xml + then + killall osd_cat + echo -e "Updates available!\n Exit and reenter Service Menu\n to perform updates." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 10 -A centre + exit + else + echo -e "Checking for updates." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 300 -A centre & + fi +} +chck () { + sudo pacman -Sy + sudo pacman -Qu > /tmp/check_update + sudo grep Target /tmp/check_update > /tmp/to_be_upgraded + if grep -q no\ upgrades\ found /tmp/check_update + then + killall osd_cat + echo -e "No updates available\n at this time." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 5 -A centre + else + mv /usr/share/mythtv/linhes.xml /tmp/linhes.xml.tmp + sed -e '/\#Check/,/\#Check/d' < /tmp/linhes.xml.tmp > /usr/share/mythtv/linhes.xml + mv /usr/share/mythtv/linhes.xml /tmp + grep -v -e /mythmenu /tmp/linhes.xml > /tmp/linhes.xml.tmp + echo "<!--#UpdatesAvailable-->" >> /tmp/linhes.xml.tmp + echo " <button>" >> /tmp/linhes.xml.tmp + echo " <type>UPGRADE</type>" >> /tmp/linhes.xml.tmp + echo " <text>Updates Available</text>" >> /tmp/linhes.xml.tmp + echo " <action>MENU update2.xml</action>" >> /tmp/linhes.xml.tmp + echo " </button>" >> /tmp/linhes.xml.tmp + echo "<!--#UpdatesAvailable-->" >> /tmp/linhes.xml.tmp + echo "</mythmenu>" >> /tmp/linhes.xml.tmp + mv /tmp/linhes.xml.tmp /usr/share/mythtv/linhes.xml + dsply + fi + } +dsply +chck |