aboutsummaryrefslogtreecommitdiff
path: root/network/atheme/doinst.sh
diff options
context:
space:
mode:
authorDavid Woodfall <dave@dawoodfall.net>2017-10-27 19:46:31 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-10-28 07:07:04 +0700
commita92a72b5c96a6e1e9525f2a6c996cfa47f198492 (patch)
tree65bbdb45347e044ff5e8cf5608b2f31164524653 /network/atheme/doinst.sh
parent609f70cc53121c7b8c74f39eadebd688b3d19353 (diff)
network/atheme: Added (Atheme IRC Services).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/atheme/doinst.sh')
-rw-r--r--network/atheme/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/network/atheme/doinst.sh b/network/atheme/doinst.sh
new file mode 100644
index 000000000000..57d52b5f0826
--- /dev/null
+++ b/network/atheme/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.atheme.new