summarylogtreecommitdiffstats
path: root/forge-server-custom.install
diff options
context:
space:
mode:
authorNitroretro2019-12-30 09:19:05 +0200
committerNitroretro2019-12-30 09:19:05 +0200
commit82ae189477865abc3fdfcdd87c660732120e5f3f (patch)
tree6b8db029193c9d99862979544b489c6aa08244df /forge-server-custom.install
parenta20f95ac82bce01cde79f6ba41cff7edb53728ee (diff)
downloadaur-82ae189477865abc3fdfcdd87c660732120e5f3f.tar.gz
Upgrade: 1.9.4_12.17.0.1976-4
Diffstat (limited to 'forge-server-custom.install')
-rw-r--r--forge-server-custom.install28
1 files changed, 28 insertions, 0 deletions
diff --git a/forge-server-custom.install b/forge-server-custom.install
new file mode 100644
index 000000000000..b42577dcd3f3
--- /dev/null
+++ b/forge-server-custom.install
@@ -0,0 +1,28 @@
+post_install() {
+ if ! getent group "forge" &>/dev/null; then
+ echo "Adding forge system group..."
+ groupadd -r forge 1>/dev/null
+ fi
+
+ if ! getent passwd "forge" &>/dev/null; then
+ echo "Adding forge system user..."
+ useradd -r -g forge -d /srv/forge forge 1>/dev/null
+ fi
+
+ chown -R forge:forge /srv/forge
+
+ echo "The world data is stored under /srv/forge and the server runs as the forge user to increase security."
+ echo "Use the forged script under /usr/bin/forged to start, stop or backup the server."
+ echo "Adjust the configuration file under /etc/conf.d/forge to your liking."
+ echo "For the server to start you have to accept the EULA in /srv/forge/eula.txt!"
+ echo "The EULA file is generated after the first server start."
+}
+
+post_upgrade() {
+ chown -R forge:forge /srv/forge
+}
+
+post_remove() {
+ [ -d "/srv/forge" ] && echo "Game saves in /srv/forge were kept on your system."
+ echo "The forge user was preserved on your system."
+}