autoupdate: add initial support for /etc/repo.conf, some cleanups

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-08-08 12:56:41 +02:00
parent 1b681833e6
commit c65bb01ede
4 changed files with 37 additions and 23 deletions

View File

@ -0,0 +1,8 @@
# Location of repo
UPDATEURL="http://snapshots.openelec.tv"
# Setup Download tool (wget/scp)
DL_METHOD="wget"
# Keyfile to use (with scp method)
KEYFILE=

View File

@ -4,14 +4,17 @@
mkdir -p $INSTALL/usr/bin
if [ "$DEVTOOLS" = "yes" ]; then
cp -P $PKG_DIR/scripts/autoupdate.devel $INSTALL/usr/bin/autoupdate
cp $PKG_DIR/scripts/autoupdate.devel $INSTALL/usr/bin/autoupdate
else
cp -P $PKG_DIR/scripts/autoupdate.release $INSTALL/usr/bin/autoupdate
cp $PKG_DIR/scripts/autoupdate.release $INSTALL/usr/bin/autoupdate
fi
mkdir -p $INSTALL/usr/config
cp -P $PKG_DIR/config/update.conf $INSTALL/usr/config
mkdir -p $INSTALL/etc
cp $PKG_DIR/config/repo.conf $INSTALL/etc
mkdir -p $INSTALL/etc/crontabs
echo -e "* */6 * * *\t/usr/bin/autoupdate" >> $INSTALL/etc/crontabs/root

View File

@ -20,8 +20,16 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
[ -f /storage/.config/update.conf ] && \
. /storage/.config/update.conf
[ -f /storage/.config/update.conf ] && . /storage/.config/update.conf
[ -f /etc/repo.conf ] && . /etc/repo.conf || exit0
download () {
wget -c $1 -P /tmp
}
send_message () {
xbmc-send --host=127.0.0.1 -a "Notification(Automatic update service:,$1,20000)"
}
if [ ! -f /var/lock/update.lock ]; then
@ -30,12 +38,6 @@ if [ ! -f /var/lock/update.lock ]; then
# sleep a bit, maybe we have a lot of work ;-)
usleep 30000000
send_message () {
xbmc-send --host=127.0.0.1 -a "Notification(Automatic update service:,$1,20000)"
}
UPDATEURL="http://snapshots.openelec.tv"
# getting this version
THIS_DISTRIBUTION="`cat /etc/distribution`"
THIS_ARCH="`cat /etc/arch`"
@ -43,7 +45,7 @@ if [ ! -f /var/lock/update.lock ]; then
# get infofile with the latest released version
rm -rf /tmp/latest
wget $UPDATEURL/latest -P /tmp
download "$UPDATEURL/latest"
NEW_IMAGE="`cat /tmp/latest |grep "$THIS_DISTRIBUTION-$THIS_ARCH"`"
NEW_VERSION="`echo "$NEW_IMAGE" | cut -d "-" -f5 | tr -d "r"`"
@ -69,7 +71,7 @@ if [ ! -f /var/lock/update.lock ]; then
touch /var/lock/update.lock
# downloading the new version
wget -c $UPDATEURL/$NEW_IMAGE.tar.bz2 -P /tmp
download "$UPDATEURL/$NEW_IMAGE.tar.bz2"
# extract the image
rm -rf /tmp/$NEW_IMAGE

View File

@ -20,8 +20,16 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
[ -f /storage/.config/update.conf ] && \
. /storage/.config/update.conf
[ -f /storage/.config/update.conf ] && . /storage/.config/update.conf
[ -f /etc/repo.conf ] && . /etc/repo.conf || exit0
download () {
wget -c $1 -P /tmp
}
send_message () {
xbmc-send --host=127.0.0.1 -a "Notification(Automatic update service:,$1,20000)"
}
if [ ! -f /var/lock/update.lock ]; then
@ -30,12 +38,6 @@ if [ ! -f /var/lock/update.lock ]; then
# sleep a bit, maybe we have a lot of work ;-)
usleep 30000000
send_message () {
xbmc-send --host=127.0.0.1 -a "Notification(Automatic Update Service:,$1,20000)"
}
UPDATEURL="http://releases.openelec.tv"
# getting this version
THIS_DISTRIBUTION="`cat /etc/distribution`"
THIS_ARCH="`cat /etc/arch`"
@ -46,7 +48,7 @@ if [ ! -f /var/lock/update.lock ]; then
# get infofile with the latest released version
rm -rf /tmp/latest
wget $UPDATEURL/latest -P /tmp
download "$UPDATEURL/latest"
NEW_IMAGE="`cat /tmp/latest |grep "$THIS_DISTRIBUTION-$THIS_ARCH"`"
NEW_VERSION="`echo "$NEW_IMAGE" | cut -d "-" -f3`"
@ -76,7 +78,7 @@ if [ ! -f /var/lock/update.lock ]; then
touch /var/lock/update.lock
# downloading the new version
wget -c $UPDATEURL/$NEW_IMAGE.tar.bz2 -P /tmp
download "$UPDATEURL/$NEW_IMAGE.tar.bz2"
# extract the image
rm -rf /tmp/$NEW_IMAGE
@ -96,7 +98,6 @@ if [ ! -f /var/lock/update.lock ]; then
mv /storage/.update/KERNEL.tmp /storage/.update/KERNEL
mv /storage/.update/SYSTEM.tmp /storage/.update/SYSTEM
touch /var/
# cleanup tmp files
rm -rf /tmp/$NEW_IMAGE
rm -rf /tmp/$NEW_IMAGE.tar.bz2