aboutsummaryrefslogtreecommitdiff
path: root/games/tetrinetx/doinst.sh
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-02-13 20:21:28 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-02-18 10:06:44 +0700
commit1edb88fa2927306fd2ccfe36fcce804e79bbeace (patch)
treea5fa53966c57d04ffa1790552393d20aa9eb29c3 /games/tetrinetx/doinst.sh
parent998d466e2f7684fff8199ef4c94c75ca8a1344c3 (diff)
games/tetrinetx: Added (TetriNET server)
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/tetrinetx/doinst.sh')
-rw-r--r--games/tetrinetx/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/games/tetrinetx/doinst.sh b/games/tetrinetx/doinst.sh
new file mode 100644
index 0000000000000..ae1bf754cab66
--- /dev/null
+++ b/games/tetrinetx/doinst.sh
@@ -0,0 +1,26 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.tetrinetx.new
+config etc/tetrinetx/game.conf.new
+config etc/tetrinetx/game.motd.new
+config etc/tetrinetx/game.pmotd.new
+config etc/tetrinetx/game.secure.new