summaryrefslogtreecommitdiff
path: root/network/lighttpd2/doinst.sh
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2012-09-08 11:40:57 +0200
committerRobby Workman <rworkman@slackbuilds.org>2012-09-08 17:28:33 -0500
commit1efbfb7da270de37c67b7bb8a90890cdaf574a71 (patch)
tree24e329b2601bb72b7d0003b27d08274fb5b4b7cd /network/lighttpd2/doinst.sh
parentc5774c9ed118e4a4a506291eea1747faca26f660 (diff)
downloadslackbuilds-1efbfb7da270de37c67b7bb8a90890cdaf574a71.tar.gz
network/lighttpd2: Added (light, fast, and secure webserver).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network/lighttpd2/doinst.sh')
-rw-r--r--network/lighttpd2/doinst.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/network/lighttpd2/doinst.sh b/network/lighttpd2/doinst.sh
new file mode 100644
index 0000000000..58590b923f
--- /dev/null
+++ b/network/lighttpd2/doinst.sh
@@ -0,0 +1,36 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+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
+}
+
+config etc/lighttpd2/lighttpd.conf.new
+config etc/lighttpd2/angel.conf.new
+config etc/lighttpd2/mimetypes.conf.new
+config etc/logrotate.d/lighttpd2.new
+preserve_perms etc/rc.d/rc.lighttpd2.new
+preserve_perms etc/rc.d/rc.spawn-fcgi.new
+
+# Create dummy logfiles, but throw them away if logfiles are already here:
+for i in access error ; do
+ if [ -e var/log/lighttpd2/${i}.log ]; then
+ rm -f var/log/lighttpd2/${i}.log.new
+ else
+ mv var/log/lighttpd2/${i}.log{.new,}
+ fi
+done