#!/bin/sh user="seqkit" myDomain="hyldap" passwd="******" echo -n "">./passwd.ldif echo -n "">./group.ldif for i in $user do echo "Start write user info to passwd.ldif group.ldif" grep "^${i}:" /etc/passwd >>./passwd.ldif grep "^${i}:" /etc/group >>./group.ldif echo "End" done echo "add $i passwd info(start)" /usr/share/migrationtools/migrate_passwd.pl ./passwd.ldif |ldapadd -c -x -D "cn=Manager,dc=$myDomain,dc=com" -w $passwd echo "add $i passwd info:(end)"$? echo "add $i group info:(start)" /usr/share/migrationtools/migrate_group.pl ./group.ldif | ldapadd -c -x -D "cn=Manager,dc=$myDomain,dc=com" -w $passwd echo "add $i group info:(end)"$?
openladp 添加用户脚本,布布扣,bubuko.com
原文地址:http://51leih.blog.51cto.com/9009229/1430492