X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_free?a=blobdiff_plain;f=jessie_postinstall.sh;h=1b2978aec1c34ed181d2eec3259b68433f9ce9e1;hb=67e783c56b750fdb3d9e77eada3cd3dd9935d5f7;hp=0884d132be63bef8fa155eaf86312da57cc5f2c9;hpb=bd65e1f84959f17cf26945c9f244a091e38c57af;p=config diff --git a/jessie_postinstall.sh b/jessie_postinstall.sh index 0884d13..1b2978a 100755 --- a/jessie_postinstall.sh +++ b/jessie_postinstall.sh @@ -12,6 +12,23 @@ if [ "$1" = "thinkpad" ] && [ ! "$2" = "X200s" ] && [ ! "$2" = "T450s" ]; then false fi +if [ "$1" = "server" ] && [ ! "$2" = "plomlompom.com" ] && \ + [ ! "$2" = "test.plomlompom.com" ]; then + echo "Need server type." + false +fi + +# Some important variables +if [ "$2" = "plomlompom.com" ]; then + hostname="plomlompom" +elif [ "$2" = "test.plomlompom" ]; then + hostname="test.plomlompom.com" +elif [ "$2" = "X200s" ]; then + hostname="X220s" +elif [ "$2" = "T450s" ]; then + hostname="T450s" +fi + if [ "$1" = "server" ]; then # Set root pw. passwd @@ -35,13 +52,13 @@ rm list_all_packages list_white_unsorted list_white list_black echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99mindeps echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/99mindeps +# Set hostname and FQDN. +echo $hostname > /etc/hostname +hostname $hostname if [ "$1" = "server" ]; then - # Set hostname and FQDN. - echo 'plomlompom' > /etc/hostname - hostname 'plomlompom' echo '127.0.0.1 localhost' > /etc/hosts ip=`hostname -I` - echo "$ip plomlompom.com plomlompom" >> /etc/hosts + echo "$ip $2 $hostname" >> /etc/hosts # Call dhclient on startup. cat > /etc/systemd/system/dhclient.service << EOF @@ -55,12 +72,6 @@ ExecStart=/sbin/dhclient eth0 WantedBy=multi-user.target EOF systemctl enable /etc/systemd/system/dhclient.service -elif [ "$1" = "thinkpad" ]; then - if [ "$2" = "X200s" ]; then - echo 'X200s' > /etc/hostname - elif [ "$2" = "T450s" ]; then - echo 'T450s' > /etc/hostname - fi fi # Package management config, system upgrade.