-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dominik Jakielski
committed
Apr 5, 2024
1 parent
7c8f20a
commit 46ba479
Showing
4 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
ldapadd $([[ -n "$1" ]] && echo "-a $1") < "/tmp/import.ldif" | ||
# shellcheck disable=SC2046 | ||
ldapadd -x $([[ -n "$1" ]] && echo "-D $1") $([[ -n "$2" ]] && echo "-w $2") -f /tmp/import.ldif | ||
echo "Imported" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
dn: uid=test.user,ou=users,dc=example,dc=org | ||
# LDIF file to create two users | ||
|
||
# Entry for User 1 | ||
dn: uid=testuser1,ou=users,dc=example,dc=com | ||
changetype: add | ||
objectclass: iNetOrgPerson | ||
cn: Test User | ||
sn: Test | ||
mail: test.user@example.org | ||
userPassword: Password1 | ||
objectClass: inetOrgPerson | ||
objectClass: posixAccount | ||
cn: User 1 | ||
uid: user1 | ||
sn: Lastname1 | ||
userPassword: Password123 | ||
uidNumber: 1001 | ||
gidNumber: 1001 | ||
homeDirectory: /home/user1 | ||
|
||
# Entry for User 2 | ||
dn: uid=testuser2,ou=users,dc=example,dc=com | ||
changetype: add | ||
objectClass: inetOrgPerson | ||
objectClass: posixAccount | ||
cn: User 2 | ||
uid: user2 | ||
sn: Lastname2 | ||
userPassword: Password456 | ||
uidNumber: 1002 | ||
gidNumber: 1002 | ||
homeDirectory: /home/user2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters