#! /bin/sh

catnc() {
    # cat but no comment lines
    egrep -v "^#" $1
}

# echo architecture and OS name in upper case. Do NOT remove these two lines
uname -s | tr '[:lower:]' '[:upper:]'
[ -x "`which dpkg`" ] && dpkg --print-installation-architecture | tr /a-z/ /A-Z/

# all hosts named ant?? are using the classes in file anthill
case $HOSTNAME in
    ant??) catnc anthill ;;
esac

# all hosts named nuerburg? are becoming web kiosk systems
case $HOSTNAME in
    nuerburg?) catnc wwwkiosk ;;
esac

# the Beowulf cluster; all nodes except the master node use classes from file class/atoms
case $HOSTNAME in
    atom00) echo "BEOWULF BEOWULF_MASTER NETTOOLS NTP DHCP_SERVER DNS_SERVER";;
    atom??) catnc atoms ;;
esac

# if host belongs to class C subnet 123.45.6.0 use class NET_6
# exclude all hosts with an IP address above 200
case $IPADDR in
    123.45.6.2??) ;;
    123.45.*.*)	catnc koeln ;;
    123.45.6.*)	echo "CS_KOELN NET_6" ;;
esac

# use a list of classes for a demo machine
case $HOSTNAME in
    demohost)
	catnc demo ;;
esac
