I am writing up an installer script for myself. I am aiming this thing at Ubuntu / Mint at the moment but would like it to be easily portable with straight Debian or quickly modified to work with something non Debian based. I am trying to get it to test the distro. If it is ubuntu or mint then it runs the ppa function. if not then it just moves on down the list in the while loop running the functions.
Code:
testdistro()
{
if cat /proc/version | grep [U,u]buntu ; then
addppa
elif cat /proc/version | grep [M,m]int ; then
addppa
fi
}
addppa() ###Called from testdistro###
{
if [ ! -s $SOURCES.d/satyajit-happy* ] ; then
add-apt-repository ppa:satyajit-happy/themes
fi
}
Is there a better way of doing this? Smaller and more compact maybe?