summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Krogh <markus@nordu.net>2018-06-06 14:06:08 +0200
committerMarkus Krogh <markus@nordu.net>2018-06-06 14:06:08 +0200
commit382b226fd44796a1dbff6219c348afe8f90a8d40 (patch)
tree51c00df5d382b9ab05528f92f97d8c489d6fbcf2
parent65c8377d1716346a04e99e679f34bbb0d4f8bb0e (diff)
Adding ldap search check
-rwxr-xr-xinstall.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index bda419b..d7c3308 100755
--- a/install.sh
+++ b/install.sh
@@ -19,6 +19,10 @@ if ! which ldapsearch >> /dev/null; then
echo "Failed to install ldap-utils"
exit 1
fi
+ if ! ldapsearch -o nettimeout=2 -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=markus))" uid >> /dev/null; then
+ echo "Failed to perform ldapsearch"
+ exit 1
+ fi
fi
if ! curl -s --show-error "$SSH_URL" > "$SSH_KEYS_PATH"; then
@@ -35,3 +39,4 @@ if ! curl -s --show-error "$CROND_URL" > "$CROND_FILE"; then
fi
sed -i -e "/MAILTO/ s/markus@nordu.net/$MAILTO/" "$CROND_FILE"
echo "cf-replace has been installed to $CROND_FILE"
+