Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@maethor
Created October 8, 2013 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maethor/6885921 to your computer and use it in GitHub Desktop.
Save maethor/6885921 to your computer and use it in GitHub Desktop.
Backupninja LDAP handler for Debian (without using slapd.conf)
# -*- 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