diff --git a/plugins/localdump/ldap.sh b/plugins/localdump/ldap.sh index 0f366b7f9f8e00b382f5071b1fc5e3af96f53b1e..bab4d9eeaefb39834c8b049ad38189b652424db6 100755 --- a/plugins/localdump/ldap.sh +++ b/plugins/localdump/ldap.sh @@ -9,8 +9,9 @@ # Location: /root/bin/backup_ldap.sh # # -------------------------------------------------------------------------------- -# 2021-12-13 ..... v1.0 detect config path -# 2021-12-13 ah v1.0 detect config path +# 202_-__-__ ..... v1.0 detect config path +# 2021-12-13 ah v1.1 detect config path +# 2021-12-14 ah v1.2 detect sbin path to execute slapcat without path # ================================================================================ @@ -24,8 +25,11 @@ fi # CONFIG # -------------------------------------------------------------------------------- - -SLAPCAT='/sbin/slapcat' +# detect sbin path (to execute slapcat without path) +for mydir in /sbin /usr/sbin +do + test -d $mydir && export PATH=$PATH:$mydir +done # detect config path LDAP_CONF_DIR_PATH=/something/unknown @@ -48,7 +52,7 @@ function dump_ldap(){ DN=$1 DUMPFILE=$2 - $SLAPCAT -F $LDAP_CONF_DIR_PATH -b $DN -l $DUMPFILE + slapcat -F $LDAP_CONF_DIR_PATH -b $DN -l $DUMPFILE fetchrc if [ $rc -ne 0 ]; then