Is there any way to distinguish between Ubuntu Server and Ubuntu Desktop?
I have a Bash script (shameless plug) that I use to set up lightweight web servers, and I've noticed that when I run this script on my own computer, my Ubuntu (Desktop) install gets all messed up - I'm pretty sure the culprit are the following lines of code:
echo -e "\e[1;32mDave, I'm removing the bloatware.\e[0m"
for halBox_package in apache2 bind9 nscd php portmap rsyslog samba sendmail; do
if [[ -f /etc/init.d/$halBox_package ]]; then
( service $halBox_package stop ) > /dev/null
fi
( apt-get -qq -y remove --purge "$halBox_package*" ) > /dev/null 2>&1
done
What I would like to do, is to detect whether the script is being ran in a Server flavour or not, so I can decide whether to purge those packages or not. If it's not possible to tell the flavors apart, can you tell me which package is necessary for Ubuntu Desktop to work properly?
Command
Result:
It will not work if someone installs the desktop without using ubuntu-desktop. But who does that?