This commit is contained in:
Bob Mottram 2015-10-31 20:28:03 +00:00
parent 1713d292d1
commit 3518ee9916
1 changed files with 3 additions and 3 deletions

View File

@ -32,14 +32,14 @@ fi
if [ "$SSH_PUBLIC_KEY" ]; then
if [ ${#SSH_PUBLIC_KEY} -gt 5 ]; then
if [ -f $SSH_PUBLIC_KEY ]; then
if [ -f "$SSH_PUBLIC_KEY" ]; then
mkdir /home/$MY_USERNAME/.ssh
cp $SSH_PUBLIC_KEY /home/$MY_USERNAME/.ssh/authorized_keys
echo 'ssh public key installed'
else
if [[ $SSH_PUBLIC_KEY == "ssh-"* ]]; then
if [[ "$SSH_PUBLIC_KEY" == "ssh-"* ]]; then
mkdir /home/$MY_USERNAME/.ssh
echo $SSH_PUBLIC_KEY > /home/$MY_USERNAME/.ssh/authorized_keys
echo "$SSH_PUBLIC_KEY" > /home/$MY_USERNAME/.ssh/authorized_keys
echo 'ssh public key installed'
else
echo 'The second parameter does not look like an ssh key'