From 1edb88fa2927306fd2ccfe36fcce804e79bbeace Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 13 Feb 2023 20:21:28 +0000 Subject: games/tetrinetx: Added (TetriNET server) Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- games/tetrinetx/doinst.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 games/tetrinetx/doinst.sh (limited to 'games/tetrinetx/doinst.sh') 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 -- cgit v1.2.3