diff options
author | Giorgio Peron <giorgio.peron@gmail.com> | 2011-10-22 09:39:40 -0200 |
---|---|---|
committer | Niels Horn <niels.horn@slackbuilds.org> | 2011-10-22 09:39:40 -0200 |
commit | 7210aa7ce7369e44f5cdbc9bf19d28f0c6106d35 (patch) | |
tree | 83618c690e995c196e623efbb0e3cebf7958a9a3 /network/jboss-as/doinst.sh | |
parent | bc62703ddf604c8b41f727ec6346a0c05bb002c3 (diff) |
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.sh | 27 |
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 000000000000..76f820b3d43a --- /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 + |