summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts/upgrade_linhes.sh
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-11-01 21:44:32 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-11-01 21:44:32 (GMT)
commita16b6fee796342b4f98d3361c232caa8bc1b946b (patch)
treeedf9247034fc2c3beac38dd33cf09027e06c9652 /abs/core/linhes-scripts/upgrade_linhes.sh
parenta699c26ba6ce8c969fa3961bc02f65bd53aca999 (diff)
downloadlinhes_pkgbuild-a16b6fee796342b4f98d3361c232caa8bc1b946b.zip
linhes_pkgbuild-a16b6fee796342b4f98d3361c232caa8bc1b946b.tar.gz
linhes_pkgbuild-a16b6fee796342b4f98d3361c232caa8bc1b946b.tar.bz2
linhes-scripts: update script for r6-r7.
to update run pacman -Sy linhes-scripts upgrade-linhes.sh and watch the fun. This script must be run as root and from a terminal. Running it from an xterm will cause it to abort. At the end of the script it will force a reboot.
Diffstat (limited to 'abs/core/linhes-scripts/upgrade_linhes.sh')
-rwxr-xr-xabs/core/linhes-scripts/upgrade_linhes.sh153
1 files changed, 21 insertions, 132 deletions
diff --git a/abs/core/linhes-scripts/upgrade_linhes.sh b/abs/core/linhes-scripts/upgrade_linhes.sh
index 91a46e6..933d994 100755
--- a/abs/core/linhes-scripts/upgrade_linhes.sh
+++ b/abs/core/linhes-scripts/upgrade_linhes.sh
@@ -1,136 +1,25 @@
#!/bin/bash
-#Script to facilitate easy upgrade to latest LinHES.
-clear
-if [ "$(id -u)" != "0" ]; then
- echo "This script must be run as root" 1>&2
- exit 1
-fi
-function pause(){
- read -p "$*"
-}
-echo "The script will guide you thru the process of upgrading to the latest LinHES."
-pause 'Press <ENTER> to continue...'
-echo
-echo "Sync'n with the repos..."
-echo
-pacman -Sy &>/dev/null
-pacman -Qu > /tmp/linhes_upgrade
-if [ ! -s /tmp/linhes_upgrade ]
-then
- echo "No upgrades found. This could mean the repository is busy."
- echo "Or your system is already up to date."
- echo "If you have not upgrade, please try again later."
- echo "Starting the backend."
- sv start mythbackend &>/dev/null
- exit 1
-fi
-if grep -E "Master|Stand" /etc/systemconfig &>/dev/null
- then
- echo "Stopping the backend."
- sv stop mythbackend &>/dev/null
-fi
-if pacman -Qs mythvodka &>/dev/null
- then
- echo "Removing MythVodka if installed as it is no longer compatible with MythTV."
- echo
- pacman -R mythvodka &>/dev/null
-fi
-echo
-echo "Backing up Online Streams listings."
-echo
-cp /usr/share/mythtv/is.xml /usr/share/mythtv/is.xml.021
-echo "Removing mythcontrol and mythphone if installed."
-echo
-if pacman -Qs mythcontrols &>/dev/null
- then
- pacman -R mythcontrols &>/dev/null
-fi
-if pacman -Qs mythphone &>/dev/null
- then
- pacman -R mythphone &>/dev/null
-fi
-if grep -q kernel26 /tmp/linhes_upgrade
+mkfifo /tmp/upgrade.fifo
+
+set | grep -q WINDOWID
+status=$?
+
+if [ $status = 0 ]
then
- echo "Upgrading the kernel."
- echo
- if pacman -Qs v4l-dvb &>/dev/null
- then
- pacman -Sf --noconfirm kernel26 &>/dev/null && pacman -Sf --noconfirm v4l-dvb
- else
- pacman -S kernel26 --noconfirm &>/dev/null
- fi
+ echo "This script must run from the console" 1>&2
+ exit 1
fi
-if grep -q v4l-dvb /tmp/linhes_upgrade
+
+
+if [ "$(id -u)" != "0" ];
then
- pacman -Sf --noconfirm v4l-dvb &>/dev/null
-fi
-echo "Checking for VDPAU packages and upgrading if needed."
-echo
-if pacman -Qs vdpinfo-71xx &>/dev/null
- then
- pacman -Rd vdpinfo-71xx &>/dev/null
-fi
-if pacman -Qs vdpinfo-96xx &>/dev/null
- then
- pacman -Rd vdpinfo-96xx &>/dev/null
-fi
-if pacman -Qs vdpinfo &>/dev/null
- then
- pacman -Rd vdpinfo &>/dev/null && pacman -S --noconfirm nvidia &>/dev/null && pacman -S --noconfirm vdpauinfo &>/dev/null
-fi
-echo "Performing complete system upgrade."
-echo "This may take some time depending on your connection speed."
-echo "Server bandwidth utilization will also have an affect."
-echo "Please be patient."
-echo
-pacman -Suf --noconfirm &>/dev/null
-echo "Restoring Online Streams listings."
-echo
-cp /usr/share/mythtv/is.xml.021 /usr/share/mythtv/is.xml
-if grep -E "Master|Stand" /etc/systemconfig &>/dev/null
- then
- echo "Starting the backend. This will automatically update the schema."
- sv start mythbackend &>/dev/null
- echo "I'll launch an xterm so you watch output backend log."
- echo "Once the schema updates are complete, switch back to this xterm."
- echo -e "\033[1mWhen you see \"Upgrading to MythTV schema version 1254\"\033[0m"
- echo "You can switch back to this xterm."
- echo -e "\033[1mNote:After pressing <ENTER>, I'll be asleep for 30 secs...\033[0m"
- echo -e "\033[1mThis will give the schema time to upgrade.\033[0m"
- pause 'Press <ENTER> to continue...'
- xterm -fn *18* -e tail -f /var/log/mythtv/mythbackend.log &
- #Sleeping for 30 seconds to give the schema time to upgrade....
- sleep 30
- read -p "Press <ENTER> to continue once the schema upgrade is complete."
- echo
- echo -e "\033[1mNow, the frontend will launch to update the schema for any plugins.\033[0m"
- echo -e "\033[1mOnce the this is done, please exit the frontend.\033[0m"
- pause 'Press <ENTER> to continue...'
- xterm -e mythfrontend
- echo
- echo "Performing LinHES specific schema updates."
- echo
- /usr/LH/bin/update_schema_021_to_022.sh
- cat /data/database/dvd_transcode_r6.sql | mysql -u root mythconverg
- /usr/LH/bin/mythwelcome-config.py
-fi
-echo "All done!"
-echo -e "\033[5mThanks for choosing LinHES!\033[0m"
-if grep -q kernel26 /tmp/linhes_upgrade
-then
- echo "The kernel was upgraded, we need to reboot."
- pause "Press <ENTER> to reboot."
- reboot
-else
- if grep -q v4l-dvb /tmp/linhes_upgrade
- then
- echo "The V4L\DVB modules were upgraded."
- pause "Press <ENTER> to reboot."
- reboot
- else
- echo "Launching mythfrontend once again!"
- echo "Enjoy the latest version!"
- sleep 5
- mythfrontend
-fi
-fi
+ echo "This script must be run as root" 1>&2
+ exit 1
+
+fi
+
+
+sv stop mythbackend
+sv stop frontend
+
+screen -c /usr/LH/etc/upgrade_screen_rc \ No newline at end of file