You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/www-apps/webdavcgi/files/reconfig

33 lines
784 B

#!/bin/bash
confDir="etc"
distConfFile="webdav.conf-dist"
sedCmd="/bin/sed"
function die ()
{
echo "reconfig error: $1" >&2
exit 1
}
if [ $1 != "install" ]; then
# nothing to be done, exit
exit 0
fi
# Set the correct path within the config file
distConfFilePath="${VHOST_ROOT}/${confDir}/${distConfFile}"
if ! ${sedCmd} -i -e "s|^\(\$INSTALL_BASE\)=.*|\1='${VHOST_ROOT}/';|" \
${distConfFilePath}
then
die "Setting INSTALL_BASE path in ${distConfFilePath} failed"
fi
# Adding logout support
# see: http://webdavcgi.sourceforge.net/doc.html#logout
echo "\$HEADER = '<div class=\"header\">WebDAV CGI - Web interface: You are logged in as <span title="'.`id -a`.'">' .\$ENV{REMOTE_USER}.'</span> (<a href="/logout">Logout</a>).</div>';" >> ${distConfFilePath}