#!/bin/bash # care about existing files function installdir() { local owner="$1" local moddir="$2" local modfile="$3" local directory="$4" mkdir -p "$directory" find $directory -exec chown "$owner" {} \; find $directory -type f -exec chmod "$modfile" {} \; find $directory -type d -exec chmod "$moddir" {} \; } post_install() { cp -n /etc/webapps/zarafa-webapp/config.example.php /etc/webapps/zarafa-webapp/config.php cp -n /etc/webapps/zarafa-webapp/debug.example.php /etc/webapps/zarafa-webapp/debug.php installdir http:http 0700 0600 /var/log/zarafa-webapp installdir http:http 0700 0600 /var/lib/zarafa-webapp }