Sha256: 944648976208e5c6791cad34c9dbb8fa935891d40794673d27071c8a782052f7

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 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
    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

2 entries across 2 versions & 1 rubygems

Version Path
sunzi-0.5.1 lib/templates/create/recipes/ssh_key.sh
sunzi-0.5.0 lib/templates/create/recipes/ssh_key.sh