diff options
author | Max Miorim <miorimmax@gmail.com> | 2010-06-14 01:35:07 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-06-14 03:18:19 -0500 |
commit | 92c7ecbb2f68716e7003e1f4e87d3199775f40ed (patch) | |
tree | 0c56eb31e24035f2f8ca837f3e7b9d93012da4c7 /network/nginx/doinst.sh | |
parent | be790d7cf8685474b215434e8a65a650a05e3e68 (diff) | |
download | slackbuilds-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.sh | 26 |
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 |