Project Teamspeak 3 self installer

I am currently  working on a project to automate the installation for Teamspeak 3.  I will make the bash script that will figure out which Linux distribution you are using.  Then the installer will undergo unique configurations to have Teamspeak 3 automatically start puting the files in the correct place.

 

I am doing this to make it easier for people who want to install Teamspeak 3 on a Linux based server.  Below is code that will figure out which Linux distribution you are using.  If anyone have any questions please leave a comment.  I will post more about the code as I work on it.
[cc lang=”bash”]
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.

OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`

GetVersionFromFile()
{
VERSION=`cat $1 | tr “\n” ‘ ‘ | sed s/.*VERSION.*=\ // `
}

if [ “${OS}” = “SunOS” ] ; then
OS=Solaris
ARCH=`uname -p`
OSSTR=”${OS} ${REV}(${ARCH} `uname -v`)”
elif [ “${OS}” = “AIX” ] ; then
OSSTR=”${OS} `oslevel` (`oslevel -r`)”
elif [ “${OS}” = “Linux” ] ; then
KERNEL=`uname -r`
if [ -f /etc/redhat-release ] ; then
DIST=’RedHat’
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SUSE-release ] ; then
DIST=`cat /etc/SUSE-release | tr “\n” ‘ ‘| sed s/VERSION.*//`
REV=`cat /etc/SUSE-release | tr “\n” ‘ ‘ | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ] ; then
DIST=’Mandrake’
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ] ; then
DIST=”Debian `cat /etc/debian_version`”
REV=””

fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST=”${DIST}[`cat /etc/UnitedLinux-release | tr “\n” ‘ ‘ | sed s/VERSION.*//`]”
fi

OSSTR=”${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})”

fi

echo ${OSSTR}
[/cc]

One thought on “Project Teamspeak 3 self installer”

Leave a Reply

Your email address will not be published. Required fields are marked *