summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/linhes-scripts/linhes_update2.sh
blob: 80945eb19cb3d5c0d5e2968ed4d19d581de27fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
killall -9 osd_cat
echo -e "Performing updates." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 300000 -A centre & 
sudo pacman -Suf --noconfirm && sudo killall -9 osd_cat
if grep -q Check\ for\ updates /usr/share/mythtv/themes/defaultmenu/linhes.xml
then
rm -fr /tmp/to_be_upgraded
killall -9 osd_cat
echo -e "Update complete." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 5 -A centre
else
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 -v -e /mythmenu /tmp/linhes.xml > /tmp/linhes.xml.tmp
echo "<!--#Check for updates-->" >> /tmp/linhes.xml.tmp
echo "   <button>" >> /tmp/linhes.xml.tmp
echo "     <type>UPGRADE</type>" >> /tmp/linhes.xml.tmp
echo "     <text>Upgrade LinHES</text>" >> /tmp/linhes.xml.tmp
echo "     <action>MENU update.xml</action>" >> /tmp/linhes.xml.tmp
echo "   </button>" >> /tmp/linhes.xml.tmp
echo "<!--#Check for updates-->" >> /tmp/linhes.xml.tmp
echo "" >> /tmp/linhes.xml.tmp
echo "</mythmenu>" >> /tmp/linhes.xml.tmp
mv /tmp/linhes.xml.tmp /usr/share/mythtv/themes/defaultmenu/linhes.xml
rm -fr /tmp/to_be_upgraded
killall -9 osd_cat
echo -e "Update complete." | osd_cat -p middle -s 5 -f"-adobe-courier-bold-*-*-*-34-*-*-*-*-*" -d 5 -A centre
fi