From b3efd66227ee5c2bf9047deb5204edaad13849bb Mon Sep 17 00:00:00 2001 From: Markus Krogh Date: Thu, 6 Dec 2018 16:01:39 +0100 Subject: Put ignoreList into separate file --- install.sh | 4 ++++ ssh-keys.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/install.sh b/install.sh index dc92988..c83fb3b 100755 --- a/install.sh +++ b/install.sh @@ -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) -- cgit v1.1