summaryrefslogtreecommitdiff
path: root/network/sqlrelay/doinst.sh
diff options
context:
space:
mode:
authorMario Preksavec <mario at slackware dot hr>2015-04-29 21:31:53 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-04-29 21:31:53 +0700
commit0af17d28124558254094dffcf037056379db6e05 (patch)
tree24287d6e310c993190d6c0eeed4e7d50be5f63a3 /network/sqlrelay/doinst.sh
parent7d47e18e23c3deb63e246da4e016dc0f2b6470d8 (diff)
downloadslackbuilds-0af17d28124558254094dffcf037056379db6e05.tar.gz
network/sqlrelay: Added (DB Connection Management).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/sqlrelay/doinst.sh')
-rw-r--r--network/sqlrelay/doinst.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/sqlrelay/doinst.sh b/network/sqlrelay/doinst.sh
new file mode 100644
index 0000000000..7722eb4e25
--- /dev/null
+++ b/network/sqlrelay/doinst.sh
@@ -0,0 +1,28 @@
+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.sqlrelay.new
+preserve_perms etc/rc.d/rc.sqlrcachemanager.new
+config etc/sqlrelay/sqlrelay.xsd.new
+config etc/sqlrelay/sqlrelay.dtd.new