summaryrefslogtreecommitdiffstats
path: root/network/jboss-as/doinst.sh
diff options
context:
space:
mode:
author Giorgio Peron2011-10-22 13:39:40 +0200
committer Niels Horn2011-10-22 13:39:40 +0200
commit7210aa7ce7369e44f5cdbc9bf19d28f0c6106d35 (patch)
tree83618c690e995c196e623efbb0e3cebf7958a9a3 /network/jboss-as/doinst.sh
parentbc62703ddf604c8b41f727ec6346a0c05bb002c3 (diff)
downloadslackbuilds-7210aa7ce7369e44f5cdbc9bf19d28f0c6106d35.tar.gz
network/jboss-as: Added (JBoss Application Server)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/jboss-as/doinst.sh')
-rw-r--r--network/jboss-as/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/network/jboss-as/doinst.sh b/network/jboss-as/doinst.sh
new file mode 100644
index 0000000000..76f820b3d4
--- /dev/null
+++ b/network/jboss-as/doinst.sh
@@ -0,0 +1,27 @@
+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
+}
+
+# Keep same perms on rc.jboss-as.new:
+preserve_perms etc/rc.d/rc.jboss-as.new
+