#!/bin/sh

set -e

if ! grep -q 3-1-1 /etc/apt/sources.list; then
    echo "deb http://archive.linutop.com/linutop 3-1-1 main" >> /etc/apt/sources.list
fi

apt-get update
apt-get remove -y --force-yes syslinux
apt-get install -y --force-yes extlinux syslinux mbr

wget -O /usr/bin/lusm-web4 http://images.linutop.com/lusm-web4
chmod a+x /usr/bin/lusm-web4

echo "Now plug a target USB key and run 'sudo lusm-web4 4'"

exit 0
