#!/bin/bash


# Autotool for setup a Linux server in certain way.
# This is script only meant for ubuntu 10.04 Maverick


# If Grub gives you any trouble, try un-comment the echo line
# Prevent Grub Hangs

# echo "GRUB_DISABLE_OS_PROBER=true" >> /etc/default/grub



# Quick Update

echo 'Quick Update!'
apt-get upgrade -y



# Install XFCE4 Desktop Enviournment

echo 'installing XFCE4 Desktop...'
sudo apt-get install --no-install-recommends xubuntu-desktop -y
echo 'XFCE completed.'



# Install Asian Language Support

echo 'Installing Asian Language Fonts..'
sudo apt-get install ttf-arphic-uming ttf-wqy-zenhei ttf-sazanami-mincho ttf-sazanami-gothic ttf-unfonts-core ttf-unfonts-extra ttf-indic-fonts ttf-tmuni ttf-dzongkha ttf-khmeros ttf-jura ttf-sinhala-lklug ttf-sil-padauk -y



# Install FreeNX and setup


echo 'FreeNX Setup'

wget 'https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz'

tar -xvf nxsetup.tar.gz

sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:freenx-team
sudo sed -i 's/maverick/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-maverick.list
sudo apt-get update
sudo apt-get install freenx


sudo cp nxsetup /usr/lib/nx/nxsetup

sudo /usr/lib/nx/nxsetup --install 



# Install Misc Programs

echo 'Installing Other Programs...'
apt-get install firefox filezilla -y




# Flush OVH Kernel away

echo 'Flushing Kernel...'
apt-get install linux-image-server -y


echo 'Removing OVH Kernel to /root'
cd /etc/grub.d/
mv 06_OVHkernel /root/

echo 'Update and done…'
update-grub



# prompt for reboot

echo 'Please Reboot!'
