summaryrefslogtreecommitdiff
path: root/network/geomyidae/doinst.sh
diff options
context:
space:
mode:
authorDavid Woodfall <dave@dawoodfall.net>2017-11-14 23:16:20 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-11-18 12:40:27 +0700
commitb0ec5572ca1cf4243b29e98c4306f66efee8edea (patch)
treec9331e0e14293b85c21da82e6a3bbe9f31405d82 /network/geomyidae/doinst.sh
parent1de52fa1fac1311093621726ad4d95abd4758e5d (diff)
downloadslackbuilds-b0ec5572ca1cf4243b29e98c4306f66efee8edea.tar.gz
network/geomyidae: Added (A small C-based gopherd).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/geomyidae/doinst.sh')
-rw-r--r--network/geomyidae/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/network/geomyidae/doinst.sh b/network/geomyidae/doinst.sh
new file mode 100644
index 0000000000..ad390552a7
--- /dev/null
+++ b/network/geomyidae/doinst.sh
@@ -0,0 +1,25 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+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.geomyidae.new