summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/linhes_update.sh
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2013-09-16 16:05:36 (GMT)
committerBritney Fransen <brfransen@gmail.com>2013-09-16 16:05:36 (GMT)
commitab5cfcecea2c03037d5829f7cc8f19153b25b343 (patch)
treeda8cc655235914ad2388f9de8092427517de9298 /abs/core/LinHES-system/linhes_update.sh
parent5c0d20865c3464770242bbe2a7594e81b067d635 (diff)
downloadlinhes_pkgbuild-ab5cfcecea2c03037d5829f7cc8f19153b25b343.zip
linhes_pkgbuild-ab5cfcecea2c03037d5829f7cc8f19153b25b343.tar.gz
linhes_pkgbuild-ab5cfcecea2c03037d5829f7cc8f19153b25b343.tar.bz2
LinHES-system: linhes_update*: update to use msg_client.py
Diffstat (limited to 'abs/core/LinHES-system/linhes_update.sh')
-rw-r--r--abs/core/LinHES-system/linhes_update.sh80
1 files changed, 37 insertions, 43 deletions
diff --git a/abs/core/LinHES-system/linhes_update.sh b/abs/core/LinHES-system/linhes_update.sh
index e5dd2ad..87ac8a1 100644
--- a/abs/core/LinHES-system/linhes_update.sh
+++ b/abs/core/LinHES-system/linhes_update.sh
@@ -1,37 +1,27 @@
#!/bin/bash
+#Called from LinHES Service Menu Check for Updates Menu
-#----------------------------------------------------------------------------
-. /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 "\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 &
+ if grep -q Updates\ Available /usr/share/mythtv/themes/defaultmenu/linhes.xml
+ then
+ msg_client.py --clear --tag "checkUpdates"
+ msg_client.py --kill
+ msg_client.py --msg "Updates available!\nExit and re-enter Service Menu\nto install the updates.|middle"
exit
- else
- killall -9 osd_cat
- 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
+ else
+ msg_client.py --msg "Checking for updates...|middle" --timeout 600 --tag "checkUpdates"
+ fi
}
+
chck () {
sudo pacman -Sy
sudo pacman -Qu > /tmp/to_be_upgraded
if [[ ! -s /tmp/to_be_upgraded ]]
- then
- killall -9 osd_cat
- 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
+ then
+ msg_client.py --clear --tag "checkUpdates"
+ msg_client.py --kill
+ msg_client.py --msg "No updates available.|middle"
+ 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
@@ -47,28 +37,32 @@ chck () {
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 || grep nvidia /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
+
+ #check for kernel update and warn reboot is required
+ if grep linux /tmp/to_be_upgraded || grep nvidia /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
-
+
+ #create menu items for each pkg to be upgraded
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
+ 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
}
+
dsply
chck