home · contact · privacy
WIP.
[config] / all_new_2018 / setup_server.sh
1 #!/bin/sh
2 # Next setup steps for a server whose login policy has just been set from
3 # the outside via ./init_user_and_keybased_login.sh.
4 set -e
5
6 # Provide maximum input for set_hostname_and_fqdn.sh.
7 if [ "$#" -ne 2 ]; then
8     echo "Need exactly two arguments (hostname, FQDN)."
9     false
10 fi
11 hostname="$1"
12 fqdn="$2"
13
14 # Adapt /etc/ to our needs by hardlinking into ./linkable_etc_files. This
15 # will set basic configurations affecting following steps, such as setup
16 # of APT and the locale selection, so needs to be right at the beginning.
17 ./hardlink_etc.sh all server
18
19 # Set hostname and FQDN.
20 ./set_hostname_and_fqdn.sh "${hostname}" "${fqdn}"
21
22 # Ensure package installation state as defined by what packages are
23 # defined as required by Debian policy and by settings in ./apt-mark/.
24 apt update
25 ./install_for_target.sh all server
26 ./purge_nonrequireds.sh all server
27
28 # Only upgrade after reducing the system to the desired minimum, so that
29 # we don't need to get more data than necessary.
30 apt -y dist-upgrade
31
32 # Set Berlin localtime.
33 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
34
35 # If we have not yet set the shell for user plom, ensure it here. This
36 # is mostly for convenience.
37 usermod -s /bin/bash plom