summarylogtreecommitdiffstats
path: root/forge-server.install
blob: e16d289e8364e9959e7b48cc63d8b1247a2eee19 (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
_game="forge"
_user="forge"
_server_root="/opt/forge-server"

post_install() {
    if ! id -u forge &>/dev/null; then
        useradd -r -d "${_server_root}" -s /usr/bin/nologin ${_user}
    fi

    chown -R "${_user}:${_user}" "$_server_root"

    echo "The world data is stored under ${_server_root} and the server runs as ${_user} user."
    echo "Prior to starting the server must accept the EULA in ${_server_root}/eula.txt."
    echo "Use systemctl to enable, start, stop, or check the status of the forge-server."
    echo "Adjust launch arguments with ${_server_root}/user_jvm_args.txt to your liking."
    echo "Adjust the server configuration file under ${_server_root}/server.properties to your liking."

}

post_upgrade() {
    chown -R "${_user}:${_user}" "$_server_root"
}

post_remove() {
    echo "Certain files in ${_server_root} have been kept on your system. You can remove them via 'rm -rf ${_server_root}'."
    echo "The ${_user} user has been kept on your system. You can remove via 'userdel ${_user}'."
}