start of command newmeta

This commit is contained in:
Benjamin Dauvergne 2014-11-28 18:29:38 +01:00
parent fd9d5867f2
commit a68e5b66f8
1 changed files with 93 additions and 0 deletions

93
lib/newmeta Normal file
View File

@ -0,0 +1,93 @@
#!/bin/bash
# syncrepl:
# rid=<replica ID>
# provider=ldap[s]://<hostname>[:port]
# searchbase=<base DN>
# [type=refreshOnly|refreshAndPersist]
# [interval=dd:hh:mm:ss]
# [retry=[<retry interval> <# of retries>]+]
# [filter=<filter str>]
# [scope=sub|one|base|subord]
# [attrs=<attr list>]
# [attrsonly]
# [sizelimit=<limit>]
# [timelimit=<limit>]
# [schemachecking=on|off]
# [network-timeout=<seconds>]
# [timeout=<seconds>]
# [bindmethod=simple|sasl]
# [binddn=<dn>]
# [saslmech=<mech>]
# [authcid=<identity>]
# [authzid=<identity>]
# [credentials=<passwd>]
# [realm=<realm>]
# [secprops=<properties>]
# [keepalive=<idle>:<probes>:<interval>]
# [starttls=yes|critical]
# [tls_cert=<file>]
# [tls_key=<file>]
# [tls_cacert=<file>]
# [tls_cacertdir=<path>]
# [tls_reqcert=never|allow|try|demand]
# [tls_ciphersuite=<ciphers>]
# [tls_crlcheck=none|peer|all]
# [suffixmassage=<real DN>]
# [logbase=<base DN>]
# [logfilter=<filter str>]
# [syncdata=default|accesslog|changelog]
set -e
echo "URL du serveur LDAP à synchroniser (exemple : ldaps://ldap.univ.fr/ ) :"
echo -n "-> "
read URL
echo
echo "Base DN à répliquer (exemple : dc=univ,dc=fr ) :"
echo -n "-> "
read BASEDN
echo
echo "Bind DN pour l'authentification (exemple : uid=syncrepl,ou=people,dc=unic,dc=fr ) :"
echo "(laisser vide si une connexion anonyme doit être utilisée)"
echo -n "-> "
read BINDDN
echo
if [ "x$BINDDN" != "x" ]; then
echo "Mot de passe de bind pour l'authentification (exemple : uid=syncrepl,ou=people,dc=unic,dc=fr ) :"
echo -n "-> "
read BINDPW
echo
fi
echo "Récapitulatif:"
echo " URL: $URL"
echo " Base DN: $BASEDN"
if [ "x$BINDDN" != "x" ]; then
echo " Bind DN: $BINDDN"
echo " Bind PW: $BINDPW"
else
echo " Connexion anonyme"
fi
echo " Base DN local: $BASEDN,ou=meta"
echo
echo " Configuration syncrepl généré:"
echo
LINE="olcSyncRepl: rid=1 provider=\"$URL\" searchbase=\"$BINDDN\" "
if [ "x$BINDDN" != "x" ]; then
LINE="$LINE bindmethod=simple binddn=\"$BINDDN\" credentials=\"$BINDPWD\" "
fi
LINE="$LINE suffixmassage=\"$BASEDN,ou=meta\""
echo " $LINE"
echo
echo " Voulez vous créez cette nouvelle branche du méta-annuaire ? (tapez oui)"
echo -n " -> "
read OUI
if [ "x$OUI" != "oui" ]; then
exit 1
fi