ldap_server: ShellCheck fixes and more strict shell opts
This commit is contained in:
parent
e25d100c06
commit
3e216a2d30
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
umask 027
|
||||
|
||||
|
@ -16,7 +18,7 @@ DATE="$(date '+%Y-%m-%d')"
|
|||
|
||||
ldapsearch -LLL -x -H ldapi:// -s base -b 'cn=Databases,cn=Monitor' \
|
||||
'(objectClass=*)' namingContexts | \
|
||||
sed -n 's/^namingContexts: \(.*\)/\1/p' | while read db ; do
|
||||
sed -n 's/^namingContexts: \(.*\)/\1/p' | while read -r db ; do
|
||||
[ "${db}" = "cn=config" ] && continue
|
||||
if ! slapcat -f /etc/openldap/slapd.conf -b "${db}" 2> /dev/null | \
|
||||
gzip > "${BACKUPDIR}/${db}.${DATE}.gz" ; then
|
||||
|
|
Loading…
Add table
Reference in a new issue