17 lines
715 B
Bash
17 lines
715 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ -f "${HOME}/password-store/ldap.password" ]; then
|
||
|
searchopts="-y ${HOME}/password-store/ldap.password"
|
||
|
else
|
||
|
searchopts="-W"
|
||
|
fi
|
||
|
|
||
|
if [ "$USER" == 'root' ]; then
|
||
|
alias ldapsearch="/usr/bin/ldapsearch -x -b 'dc=aninix,dc=net'"
|
||
|
else
|
||
|
alias ldapsearch="/usr/bin/ldapsearch -H 'ldap://127.0.0.1/' ${searchopts} -D 'uid=$USER,ou=People,dc=aninix,dc=net' -b dc=aninix,dc=net"
|
||
|
fi
|
||
|
alias ldapmodify="/usr/bin/ldapmodify -H 'ldap://127.0.0.1/' ${searchopts} -D "cn=root,dc=aninix,dc=net""
|
||
|
alias ldappasswd="/usr/bin/ldappasswd -H 'ldap://127.0.0.1/' ${searchopts} -D "cn=root,dc=aninix,dc=net""
|
||
|
alias ldapadd="/usr/bin/ldapadd -H 'ldap://127.0.0.1/' ${searchopts} -D "cn=root,dc=aninix,dc=net""
|