624077d3529c45b8b802a7f1c5fc9dca31ec32f7
[automated-distro-installer] / fai / config / class / 50-host-classes
1 #!/bin/bash -l
2
3 # assign classes to hosts based on their hostname
4
5 # do not use this if a menu will be presented
6 [ "$flag_menu" ] && exit 0
7
8 # use a list of classes for our demo machine
9 echo "FAIBASE DEBIAN"
10 case $HOSTNAME in
11 demohost)
12 echo "DESKTOP" ;;
13 tp)
14 echo "DESKTOP PARTITION_PROMPT"
15 # For multi-boot system.
16 # Check that we aren't in a pxe boot environment.
17 # There is probably a better way to do this.
18 # We check the reverse condition in 51-multi-boot,
19 # and set what os we are installing, but don't check it
20 # into git since it changes regularly.
21 # It's shell looks like this:
22 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
23 # case $HOSTNAME in
24 # tp) : ;;
25 # # add more multi-boot hostnames here
26 # esac
27 # fi
28 #
29 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
30 echo "STABLE"
31 fi
32 ;;
33 x2|frodo|treetowl)
34 echo "NON_FREE"
35 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
36 echo "STABLE STABLE_NON_FREE"
37 fi
38 ;;
39 lj)
40 echo "LINODESTABLE PARTITION_PROMPT" ;;
41 li)
42 echo "LINODESTABLE PARTITION_PROMPT" ;;
43 do)
44 echo "STABLE PARTITION_PROMPT" ;;
45 # faiserver)
46 # echo "DEMO FAISERVER" ;;
47 # xfcehost)
48 # echo "DEMO XORG XFCE LVM";;
49 # gnomehost)
50 # echo "DEMO XORG GNOME";;
51 # centos)
52 # echo "FAIBASE CENTOS" # you may want to add class XORG here
53 # ifclass I386 && echo CENTOS6_32 # AFAIK there's no 32bit C7
54 # ifclass AMD64 && echo CENTOS7_64
55 # exit 0 ;; # CentOS does not use the GRUB class
56 # slchost)
57 # # Scientific Linux Cern, is very similar to CentOS. SLC should alsways use the class CENTOS
58 # echo "FAIBASE CENTOS SLC" # you may want to add class XORG here
59 # ifclass I386 && echo SLC7_32
60 # ifclass AMD64 && echo SLC7_64
61 # exit 0 ;; # CentOS/SLC does not use the GRUB class
62 *)
63 echo "DESKTOP" ;;
64 esac
65
66 if grep ^52:54:00: /sys/class/net/eth0/address &>/dev/null; then
67 # if our eth0 mac is in the kvm range, we are a vm.
68 echo "VM"
69 fi