openldap2/slapd-ldif-update-crc.sh
Jan Engelhardt 17245dd92c Accepting request 1190307 from home:jamborm:gcc14test-m
- Backported one hunk from upstream commit fb9e6a81bbee as
  openldap2-fb9e6a81bbee.patch to fix incompatible pointer type being
  passed to a function which is diagnosed as an error by GCC 14.

If the request is OK, please forward it to Factory soon so that we can
switch the default compiler.  Thanks!

OBS-URL: https://build.opensuse.org/request/show/1190307
OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=323
2024-07-31 04:59:13 +00:00

34 lines
758 B
Bash

#!/bin/bash
# Script to fix the crc of openldap slapd.d ldifs.
source /usr/lib/openldap/update-crc
if [ -z ${1} ]; then
echo "Usage: ${0} /etc/openldap/slapd.d/<config ldif to update>"
exit 1
fi
if [ ! -f "${1}" ]; then
echo "File ${1} does not exist?"
echo "Usage: ${0} /etc/openldap/slapd.d/<config ldif to update>"
exit 1
fi
# Make sure slapd.service is not running.
slapd_running=1
# Don't check if no systemd, we could be in a container.
if [ -f "/usr/bin/systemctl" ]; then
/usr/bin/systemctl is-active --quiet slapd.service
slapd_running=$?
fi
if [ $slapd_running -eq 0 ]; then
echo "Unable to update crc of '${1}' while slapd.service is running ..."
exit 1
fi
do_update_crc ${1}
echo "Updated crc of ${1}"