#!/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
时间: 2024-12-28 18:07:47