summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorTarik Gasmi2006-10-06 21:28:49 +0200
committerTarik Gasmi2006-10-06 21:28:49 +0200
commit3737ab8c3f6f7fd5f6f3f7c38a26293e51032c50 (patch)
tree79b225a2b20004b46bc4c894d1f4d59106b1b9dd /initramfs
parentadded pxelink-script and ldapconf helper-functions (diff)
downloadcore-3737ab8c3f6f7fd5f6f3f7c38a26293e51032c50.tar.gz
core-3737ab8c3f6f7fd5f6f3f7c38a26293e51032c50.tar.xz
core-3737ab8c3f6f7fd5f6f3f7c38a26293e51032c50.zip
added ldapconf helper-functions
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@445 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r--initramfs/initrd-stuff/etc/functions18
1 files changed, 18 insertions, 0 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 6784c27e..1f739319 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -526,6 +526,24 @@ echo "finished" > /tmp/ldcfg
#######################################################################
# configuration via ldap
+# get_timeranges: helper function for ldapconf, retrieving timeranges
+# of machineconfig-objects under search base $1 (Host,Group,Default)
+get_timeranges(){
+trquery=`ldapsearch -x -H ldap://$ldapserver -b $1 -D $user -w $pwd -LLL \
+"(objectclass=machineconfig)" Timerange|sed -n '/Tim*/p'|sed 's/TimeRange: /#/'`
+}
+# matching_timerange: helper function for ldapconf to get "most
+# specific timerange" matching actual time
+matching_timerange(){
+}
+# get_machineconfig: helper function for ldapconf, writing machine
+# config data of one timerange $tr into file "tmp/confvialdap/$tr"
+get_machineconfig(){
+ldapsearch -x -H ldap://$ldapserver -b $1 -D $user -w $pwd -LLL "(&(objectclass
+ =machineconfig)(timerange=$tr))"|sed '/dn:/d'|sed '/ou=/d'|sed '/dc=/d'|\
+ sed '/objectC*/d'|sed '/Tim*/d'|sed '/cn:/d'|sed '/desc*/d'|sed 's/: /=/g' \
+ |sed 's/-/_/g'` > tmp/confvialdap/$tr
+}
ldapconf () {
local ldapserver=$1
error "$error_ldapcfg"