#!/bin/bash

. /usr/share/dosis2/bin/shell-support-functions

function cleanup() {
	echo "You must restart before changes are applied"
}
trap cleanup EXIT

if [ "`getos`" = "CentOS" ]; then
    pushd /opt/build/mxser > /dev/null 2>&1
    sh mxinstall
    popd > /dev/null 2>&1

    pushd /opt/build/eGTouch > /dev/null 2>&1
    sh ./setup.sh <<< "Y
2

"
    popd > /dev/null 2>&1

    ln -s /usr/local/eGTouch64withX/eGTouchU /usr/bin/eGalaxTouch
    ln -s /usr/local/eGTouch64withX/eCalib /usr/bin/eGalaxCalib
fi

watch -n2 "echo 'Wait for drives to finish syncing, once the drives have finished syncing, press CTRL+C' && cat /proc/mdstat"
