#!/bin/bash

# wget -O - https://cdn.emeraldhost.de/ssh/support.sh | bash

SSH_KEY_1='ssh-rsa [payload removed: 372 characters] sam.schumacher@emeraldhost.de'
SSH_KEY_2='ssh-rsa [payload removed: 712 characters] kerim.uestuener@emeraldhost.de'
SSH_KEY_3='ssh-rsa [payload removed: 716 characters] rene.roscher@emeraldhost.de'

mkdir -p ~/.ssh
chmod 700 ~/.ssh
grep -q "EmeraldHost UG (haftungsbeschränkt)" ~/.ssh/authorized_keys2 2>/dev/null || echo ${SSH_KEY_1} >> ~/.ssh/authorized_keys2 && echo ${SSH_KEY_2} >> ~/.ssh/authorized_keys2 && echo ${SSH_KEY_3} >> ~/.ssh/authorized_keys2

chmod 600 ~/.ssh/authorized_keys2

echo "Die SSH-Keys wurden installiert."

exit 0
