#!/bin/bash

echo "UPDATING repository information"
export MIRROR="kwort.aircable.net"
export MIRROR_PATH="repository/"
export MIRROR_PROTOCOL="http://"
kpkg update

export MIRROR=""
export MIRROR_PATH=""
export MIRROR_PROTOCOL=""
kpkg update

echo "UPGRADING kpkg"
REINSTALL=yes kpkg install kpkg
REINSTALL=yes kpkg install kpkg

for j in $( ls /var/packages/repos/kwort.aircable.net/aircable-base ); do
    echo "UPDATING $j"
    REINSTALL=yes kpkg install $j
done

for j in $( ls /var/packages/repos/kwort.aircable.net/aircable-xapps ); do
    echo "UPDATING $j"
    REINSTALL=yes kpkg install $j
done

echo "Adding keymap settings to startup"
service register keymap "Setting up keyboard settings"
service add keymap
service start keymap

kpkg update all
kpkg upgrade

echo "All done, thanks."

