Commit e81c710f authored by guanghongwei's avatar guanghongwei

修改添加sudo时的小bug

parent 6273edde
dn: cn=guanghongwei,ou=Sudoers,dc=yolu,dc=com
dn: cn=guanghongwei,ou=Sudoers,dc=dianping,dc=com
objectClass: top
objectClass: sudoRole
cn: guanghongwei
......
......@@ -12,7 +12,7 @@ dir=$(cwd)
sudo_file=${dir}/sudo.ldif
user_sudo_file=${dir}/sudouser.ldif
user_sudo_file=${dir}/${username}.ldif
if [ -z $1 ];then
echo
......@@ -27,6 +27,10 @@ if [ $? != '0' ];then
exit 3
fi
sed -i "/guanghongwei/ s@dianping@$domain@g" ${sudo_file}
sed -i "/guanghongwei/ s@com@$suffix@g" ${sudo_file}
sed -e "s@guanghongwei@$username@g" ${sudo_file} > $user_sudo_file
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=$domain,dc=$suffix" -f $user_sudo_file
\ No newline at end of file
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=$domain,dc=$suffix" -f $user_sudo_file
rm -f $user_sudo_file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment