#!/bin/bash

## sqplazyprep.sh v1.02 (15th January 2015)
##  I'm too lazy to describe what this does.

if [ $# -lt 1 ]; then
	echo "Usage $0 <version>"
	echo "I need at least the version of SQPOS that I'm going to be!"
	exit 1
fi

if [ "$USER" != "root" ]; then
	echo "I require superuser privileges."
	exit 0
fi

# The usual.
apt-get update
apt-get -y upgrade

# Avahi for Shairport
apt-get -y install avahi-daemon libavahi-client3
rm /etc/init/avahi-cups-reload.conf

# NFS
apt-get -y install nfs-common

# LAME
apt-get -y install lame

# Our full setup.
ofsetup gma

# SqueezePlay installation.
echo $1 > /etc/sqpos.ver
wget http://birdslikewires.co.uk/download/openframe/squeezeplay/sqpinstall.sh
chmod +x ./sqpinstall.sh
./sqpinstall.sh auto
rm -fv /home/joggler/sqpinstall.sh /home/joggler/sqplazyprep.sh /etc/sqpbeta 2>/dev/null

# Tidy up.
ofclean auto deldev

echo 
echo "SqueezePlay OS Lazy Setup complete."
echo
exit 0