Created
October 8, 2013 14:47
-
-
Save maethor/6885921 to your computer and use it in GitHub Desktop.
Backupninja LDAP handler for Debian (without using slapd.conf)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- | |
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent: | |
HELPERS="$HELPERS ldap:ldap_database_backup" | |
ldap_create_file() { | |
while true; do | |
checkBox "ldap action wizard" "check options" \ | |
"compress" "compress the ldif output files" yes | |
status=$? | |
compress="compress = no" | |
restart="restart = no" | |
suffixes="" | |
[ $status = 1 ] && return; | |
result="$REPLY" | |
for opt in $result; do | |
case $opt in | |
'"compress"') compress="compress = yes";; | |
esac | |
done | |
inputBox "ldap action wizard" "LDAP domain components (dc) to save. Specify a space separated list:" | |
[ $? = 1 ] && return | |
suffixes="suffixes = $REPLY" | |
get_next_filename $configdirectory/30.ldap | |
cat > $next_filename <<EOF | |
$compress | |
$restart | |
$suffixes | |
# backupdir = /var/backups/ldap | |
EOF | |
chmod 600 $next_filename | |
return | |
done | |
} | |
ldap_wizard() { | |
ldap_create_file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment