home · contact · privacy
Update Firefox.
[config] / all_new_2018 / setup_scripts / 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 config_tree_prefix="${HOME}/config/all_new_2018"
15 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
16 cd "${setup_scripts_dir}"
17
18 # Adapt /etc/ to our needs by hardlinking into ./linkable_etc_files. This
19 # will set basic configurations affecting following steps, such as setup
20 # of APT and the locale selection, so needs to be right at the beginning.
21 ./hardlink_etc.sh all server
22
23 # Set hostname and FQDN.
24 ./set_hostname_and_fqdn.sh "${hostname}" "${fqdn}"
25
26 # Some debconf selections we don't want to get asked during coming
27 # install actions.
28 echo 'iptables-persistent iptables-persistent/autosave_v4 boolean false' | debconf-set-selections
29 echo 'iptables-persistent iptables-persistent/autosave_v6 boolean false' | debconf-set-selections
30
31 # Ensure package installation state as defined by what packages are
32 # defined as required by Debian policy and by settings in ./apt-mark/.
33 apt update
34 ./install_for_target.sh all server
35 ./purge_nonrequireds.sh all server
36
37 # Ensure our desired locale is available.
38 locale-gen
39
40 # Only upgrade after reducing the system to the desired minimum, so that
41 # we don't need to get more data than necessary.
42 apt -y dist-upgrade
43
44 # Set Berlin localtime.
45 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
46
47 # If we have not yet set the shell for user plom, ensure it here. This
48 # is mostly for convenience.
49 usermod -s /bin/bash plom
50
51 # We want to be able to use ALL our servers as borg backup destinations.
52 apt -y install borgbackup