aboutsummarylogtreecommitdiffstats
path: root/dom4-server.install
blob: 2fa9e86816fe17c3d3f32f47868c35449e1fc9cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
post_install() {
  post_upgrade

  systemctl daemon-reload
}

post_upgrade() {
  if hash systemd-sysusers &> /dev/null; then
    systemd-sysusers dom4.conf
  fi

  if hash systemd-tmpfiles &> /dev/null; then
    systemd-tmpfiles --create dom4.conf
  fi

  cat <<EOF
Post-install tasks:

Ensure Dominions 4 is installed to /opt/Dominions4. If you installed it from the Steam GUI with the default library path, use:

  sudo cp -R ~/.local/share/Steam/steamapps/common/Dominions4 /opt

If you installed it via SteamCMD (see README.md in the Git repository for instructions on doing that if you're starting from scratch):

  sudo cp -R ~/Steam/steamapps/common/Dominions4 /opt

If you can't find it at either of those locations, try 'locate dom4.sh' (if you *just* installed Dominions 4, 'sudo updatedb' first). This should output one line with the full path and filename of 'dom4.sh'. 'sudo cp -R' the path, excluding the filename.

Your install directory must have a 'dom4key' file present containing your Dominions 4 license key. If the file does not already exist, you can create it using the license information from Steam.

To begin setting up hosting, run 'dom4'.
EOF
}

post_remove() {
  if systemctl is-active dom4-server &> /dev/null; then
    systemctl stop dom4-server
  fi

  systemctl daemon-reload
  systemctl reset-failed

  userdel dom4 > /dev/null

  if [[ -s /usr/share/dom4/current ]]; then
    rm /usr/share/dom4/current
  fi

  rm -rf /run/dom4
}