aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/slugos-init/files/setup-optware.sh
blob: 7db87ec6b7101f9b9d927cce0284cb4ac1a6d827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

if test 0 != `id -u`; then
    echo 'Please run as root'
    exit 1
fi

case `uname -m` in
    armv5te*b)    optware_target=slugos6be;;
    *)            optware_target=slugos6le;;
esac

feed=http://ipkg.nslu2-linux.org/feeds/optware/${optware_target}/cross/unstable
latest_xsh=`wget -q -O- ${feed} | grep '\.xsh' | sed -e 's/.*xsh">//' -e 's/<.*//'`

if test -n "${latest_xsh}"; then
    cd /tmp
    rm -f "${latest_xsh}"
    wget "${feed}/${latest_xsh}"
    sh "${latest_xsh}"
fi