local config=$1
local component=$2
- if [ grep -q -x "log4perl.logger.$component" $config ]; then
+ if grep -q "log4perl.logger.$component" $config; then
return 0
else
return 1
# Take care of the instance's log4perl.conf file
for site in $(koha-list); do
log4perl_config="/etc/koha/sites/$site/log4perl.conf"
- if [ !log4perl_component $log4perl_config "z3950" ]; then
+ if ! log4perl_component $log4perl_config "z3950"; then
cat <<EOF >> $log4perl_config
log4perl.logger.z3950 = WARN, Z3950
log4perl.appender.Z3950=Log::Log4perl::Appender::File
EOF
fi
- if [ !log4perl_component $log4perl_config "api" ]; then
+ if ! log4perl_component $log4perl_config "api"; then
cat <<EOF >> $log4perl_config
log4perl.logger.api = WARN, API
log4perl.appender.API=Log::Log4perl::Appender::File
for site in $(koha-list); do
log4perl_config="/etc/koha/sites/$site/log4perl.conf"
- if [ !log4perl_component $log4perl_config "sip" ]; then
+ if ! log4perl_component $log4perl_config "sip"; then
cat <<EOF >> $log4perl_config
log4perl.logger.sip = DEBUG, SIP
log4perl.appender.SIP=Log::Log4perl::Appender::File
fi
done
+for site in $(koha-list); do
+ kohaconfig="/etc/koha/sites/$site/koha-conf.xml"
+ logdir="$( xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig )"
+ if [ "$logdir" != "" ] && [ "$logdir" != "0" ]; then
+ chown -R $site-koha:$site-koha $logdir
+ else
+ chown -R $site-koha:$site-koha /var/log/koha/$site
+ fi
+done
+
# Bug 14106 - fix the modulePath of existing koha instances so that it'll
# continue to work. This will only patch the files if the exact original string
# that we're fixing them from is there, so we just run it every time. Maybe