diff options
author | Markus Krogh <markus@nordu.net> | 2018-12-06 16:01:39 +0100 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2018-12-06 16:01:39 +0100 |
commit | b3efd66227ee5c2bf9047deb5204edaad13849bb (patch) | |
tree | 399473b3a062bd327b09fcd0e0c4148f72b2974c | |
parent | f708340132d2d881ac61b7ff4eb6bc055281ef43 (diff) |
Put ignoreList into separate file
-rwxr-xr-x | install.sh | 4 | ||||
-rw-r--r-- | ssh-keys.sh | 4 |
2 files changed, 8 insertions, 0 deletions
@@ -31,6 +31,10 @@ if ! curl -s --show-error "$SSH_URL" > "$SSH_KEYS_PATH"; then exit 1 fi +if [ ! -f /opt/cf-repalce-ignore ]; then + echo "ndn-eduix nunoc" > /opt/cf-repalce-ignore +fi + chmod +x "$SSH_KEYS_PATH" if ! curl -s --show-error "$CROND_URL" > "$CROND_FILE"; then diff --git a/ssh-keys.sh b/ssh-keys.sh index e628bbb..aec31c0 100644 --- a/ssh-keys.sh +++ b/ssh-keys.sh @@ -8,6 +8,10 @@ fi sunetEmpl="leif leifj lundberg linus per john" ignoreList="ndn-eduix nunoc" +if [ -f /opt/cf-repalce-ignore ]; then + ignoreList=$(cat /opt/cf-repalce-ignore) +fi + for userHome in /home/*; do user=$(basename "$userHome") keys_raw=$(/usr/bin/ldapsearch -o nettimeout=5 -o ldif-wrap=no -LLL -x -H "ldaps://ldap.nordu.net" -b "ou=people,dc=nordu,dc=net" "(&(employeeType=employee)(memberof=cn=ndn-sysadmin,ou=groups,dc=nordu,dc=net)(sshPublicKey=*)(uid=$user))" sshPublicKey) |