diff options
author | Markus Krogh <markus@nordu.net> | 2018-06-06 13:44:10 +0200 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2018-06-06 13:44:10 +0200 |
commit | 65c8377d1716346a04e99e679f34bbb0d4f8bb0e (patch) | |
tree | dd95f909c2651b7d27ea3fabb2fe9b06b4de56cc | |
parent | 3be1c13565cafe4be0550e6faad07e3ca38a547f (diff) |
Adding Ubuntu + cosmos checks, move ldap-utils install
-rwxr-xr-x | install.sh | 16 | ||||
-rw-r--r-- | ssh-keys.sh | 6 |
2 files changed, 16 insertions, 6 deletions
@@ -5,6 +5,22 @@ SSH_KEYS_PATH=/usr/local/bin/ssh-keys.sh SSH_URL="https://code.nordu.net/?p=cf-replace.git;a=blob_plain;f=ssh-keys.sh;hb=HEAD" CROND_URL="https://code.nordu.net/?p=cf-replace.git;a=blob_plain;f=cf-replace;hb=HEAD" +if ! grep -q -i ubuntu /etc/lsb-release; then + echo "Not installing, this is not an Ubuntu machine" + exit 1 +fi +if [ -d /var/cache/cosmos/ ]; then + echo "Not installing, machine is running cosmos" + exit 1 +fi + +if ! which ldapsearch >> /dev/null; then + if ! apt-get install -y -qq ldap-utils >> /dev/null; then + echo "Failed to install ldap-utils" + exit 1 + fi +fi + if ! curl -s --show-error "$SSH_URL" > "$SSH_KEYS_PATH"; then echo "Failed to get ssh-keys.sh file" exit 1 diff --git a/ssh-keys.sh b/ssh-keys.sh index 68f8d0c..c599514 100644 --- a/ssh-keys.sh +++ b/ssh-keys.sh @@ -1,11 +1,5 @@ #!/usr/bin/env bash ## check if ldapsearch is installed -if ! which ldapsearch >> /dev/null; then - if ! apt-get install -y -qq ldap-utils >> /dev/null; then - echo "Failed to install ldap-utils" - exit 1 - fi -fi DRY_RUN=false if [ "$1" == "-n" ]; then |