ShadowArch/EtcFiles/profile.d/shadowarch-ldap.sh

17 lines
715 B
Bash
Raw Normal View History

2024-08-12 17:26:50 -05:00
#!/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""