Sha256: e1aaa5eeb492ea926ae7b96178034a65d29869d2202e211a8ebf5187d21b62d9

Contents?: true

Size: 440 Bytes

Versions: 4

Compression:

Stored size: 440 Bytes

Contents

# SSH key
# $1: SSH key filename

if [ -f ~/.ssh/authorized_keys ]; then
  echo 'authorized_keys already created'
else
  if [ -f "files/$1" ]; then
    echo 'Creating authorized_keys'
    mkdir -p ~/.ssh
    cat "files/$1" > ~/.ssh/authorized_keys
    rm "files/$1"
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
  else
    echo "The public key file \"$1\" is not found! Look into files section in sunzi.yml."
    exit 1
  fi
fi

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sunzi-0.9.0 lib/templates/create/recipes/ssh_key.sh
sunzi-0.8.0 lib/templates/create/recipes/ssh_key.sh
sunzi-0.7.0 lib/templates/create/recipes/ssh_key.sh
sunzi-0.6.0 lib/templates/create/recipes/ssh_key.sh