detect_platform() {
# detect operating system
case $( uname -s ) in
Darwin) server_package='macosx';;
Linux) server_package='linux32'
arch=`uname -m`
if [ "$arch" = "x86_64" ]; then
server_package='linux64'
fi
;;
FreeBSD) server_package='freebsd';;
SunOS) server_package='solaris-x86'
arch=`uname -p`
if [ "$arch" = "sparc" ]; then
server_package='solaris-sparc'
fi
;;
*)
echo "Please Select the server Platform : "
echo "1) OSX"
echo "2) Linux (32bit)"
echo "3) Linux (64bit)"
echo "4) Solaris"
echo "5) Sparc"
echo "6) FreeBSD"
read n
case $n in
1) server_package='macosx';;
2) server_package='linux32';;
3) server_package='linux64';;
4) server_package='solaris-x86';;
5) server_package='solaris-sparc';;
6) server_package='freebsd';;
esac
esac
echo "Server Platform is $server_package"
}