summaryrefslogtreecommitdiff
path: root/network/nginx/doinst.sh
diff options
context:
space:
mode:
authorMax Miorim <miorimmax@gmail.com>2010-06-14 01:35:07 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-06-14 03:18:19 -0500
commit92c7ecbb2f68716e7003e1f4e87d3199775f40ed (patch)
tree0c56eb31e24035f2f8ca837f3e7b9d93012da4c7 /network/nginx/doinst.sh
parentbe790d7cf8685474b215434e8a65a650a05e3e68 (diff)
downloadslackbuilds-92c7ecbb2f68716e7003e1f4e87d3199775f40ed.tar.gz
network/nginx: Added (http server and reverse proxy)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/nginx/doinst.sh')
-rw-r--r--network/nginx/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/network/nginx/doinst.sh b/network/nginx/doinst.sh
new file mode 100644
index 0000000000..c4aaf4f4ff
--- /dev/null
+++ b/network/nginx/doinst.sh
@@ -0,0 +1,26 @@
+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.nginx.new
+config etc/logrotate.d/nginx.new