Skip to content
Snippets Groups Projects
Commit 9352d242 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

ldap backup: detect sbin path to execute slapcat without path

parent 11011f7c
No related branches found
No related tags found
1 merge request!20ldap backup: detect sbin path to execute slapcat without path
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
# Location: /root/bin/backup_ldap.sh # Location: /root/bin/backup_ldap.sh
# #
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# 2021-12-13 ..... v1.0 detect config path # 202_-__-__ ..... v1.0 detect config path
# 2021-12-13 ah 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 ...@@ -24,8 +25,11 @@ fi
# CONFIG # CONFIG
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# detect sbin path (to execute slapcat without path)
SLAPCAT='/sbin/slapcat' for mydir in /sbin /usr/sbin
do
test -d $mydir && export PATH=$PATH:$mydir
done
# detect config path # detect config path
LDAP_CONF_DIR_PATH=/something/unknown LDAP_CONF_DIR_PATH=/something/unknown
...@@ -48,7 +52,7 @@ function dump_ldap(){ ...@@ -48,7 +52,7 @@ function dump_ldap(){
DN=$1 DN=$1
DUMPFILE=$2 DUMPFILE=$2
$SLAPCAT -F $LDAP_CONF_DIR_PATH -b $DN -l $DUMPFILE slapcat -F $LDAP_CONF_DIR_PATH -b $DN -l $DUMPFILE
fetchrc fetchrc
if [ $rc -ne 0 ]; then if [ $rc -ne 0 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment