diff options
author | James Meyer <james.meyer@operamail.com> | 2011-10-19 18:31:38 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2011-10-19 18:31:38 (GMT) |
commit | d9aad8b00a9f3fb60e456c0e528df90189acb5b3 (patch) | |
tree | 6b9126d2336c62d1e5533798e7348f6a5723f6ba /abs/core/linhes-scripts/linhes_update.sh | |
parent | d9a08ac22f9c6661cf3b478927be321274d10794 (diff) | |
parent | c65b741914b31ac88086e363edc4415eb6aa1686 (diff) | |
download | linhes_pkgbuild-d9aad8b00a9f3fb60e456c0e528df90189acb5b3.zip linhes_pkgbuild-d9aad8b00a9f3fb60e456c0e528df90189acb5b3.tar.gz linhes_pkgbuild-d9aad8b00a9f3fb60e456c0e528df90189acb5b3.tar.bz2 |
Merge remote-tracking branch 'origin/testing' into testing
Conflicts:
abs/core/LinHES-config/PKGBUILD
Diffstat (limited to 'abs/core/linhes-scripts/linhes_update.sh')
-rw-r--r-- | abs/core/linhes-scripts/linhes_update.sh | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/abs/core/linhes-scripts/linhes_update.sh b/abs/core/linhes-scripts/linhes_update.sh index 39d2817..a307146 100644 --- a/abs/core/linhes-scripts/linhes_update.sh +++ b/abs/core/linhes-scripts/linhes_update.sh @@ -1,37 +1,72 @@ #!/bin/bash + +#---------------------------------------------------------------------------- +. /etc/osd_cat.cfg || { + color=yellow + outline=2 + outlinecolour=black + shadow=0 + shadowcolour=black + font="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*" +} +#---------------------------------------------------------------------------- dsply () { if grep -q Updates\ Available /usr/share/mythtv/themes/defaultmenu/linhes.xml then killall -9 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 + echo -e "\nUpdates available!\nExit and re-enter Service Menu\n to install the updates." | osd_cat --pos=middle --align=center --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & + echo -e "\nUpdates available!\nExit and re-enter Service Menu\n to install the updates." | osd_cat --pos=middle --align=center --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & exit else killall -9 osd_cat - echo -e "Checking for updates." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 300 -A centre & + echo -e "Checking for updates..." | osd_cat --pos=middle --align=center --delay=300 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & + echo -e "Checking for updates..." | osd_cat --pos=middle --align=center --delay=300 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & fi } chck () { sudo pacman -Sy sudo pacman -Qu > /tmp/to_be_upgraded -# sudo grep Target /tmp/check_update > /tmp/to_be_upgraded - if grep -q no\ upgrades\ found /tmp/check_update + if [[ ! -s /tmp/to_be_upgraded ]] then killall -9 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 + echo -e "\nNo updates available." | osd_cat --pos=middle --align=center --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & + echo -e "\nNo updates available." | osd_cat --pos=middle --align=center --delay=5 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font & else mv /usr/share/mythtv/themes/defaultmenu/linhes.xml /tmp/linhes.xml.tmp - sed -e '/\#Check/,/\#Check/d' < /tmp/linhes.xml.tmp > /usr/share/mythtv/themes/defaultmenu/linhes.xml - mv /usr/share/mythtv/themes/defaultmenu/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/themes/defaultmenu/linhes.xml + sed -e '/\#Check/,/\#Check/d' < /tmp/linhes.xml.tmp > /usr/share/mythtv/themes/defaultmenu/linhes.xml + mv /usr/share/mythtv/themes/defaultmenu/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/themes/defaultmenu/linhes.xml + + echo "<mythmenu name=\"LinHES\">" > /tmp/update3.xml.tmp + if grep kernel26 /tmp/to_be_upgraded + then + echo "" >> /tmp/update3.xml.tmp + echo " <button>" >> /tmp/update3.xml.tmp + echo " <type>UPGRADE</type>" >> /tmp/update3.xml.tmp + echo " <text>REBOOT REQUIRED</text>" >> /tmp/update3.xml.tmp + echo " <action>NONE</action>" >> /tmp/update3.xml.tmp + echo " </button>" >> /tmp/update3.xml.tmp + fi + + while read line; do + echo "" >> /tmp/update3.xml.tmp + echo " <button>" >> /tmp/update3.xml.tmp + echo " <type>UPGRADE</type>" >> /tmp/update3.xml.tmp + echo " <text>$line</text>" >> /tmp/update3.xml.tmp + echo " <action>NONE</action>" >> /tmp/update3.xml.tmp + echo " </button>" >> /tmp/update3.xml.tmp + done < "/tmp/to_be_upgraded" + echo "</mythmenu>" >> /tmp/update3.xml.tmp + mv /tmp/update3.xml.tmp /usr/share/mythtv/themes/defaultmenu/update3.xml dsply fi } |