Sha256: c530a408a690756747af3dcd9c0c12acfa6257d5f529b24ea210cf98a9313da1

Contents?: true

Size: 496 Bytes

Versions: 3

Compression:

Stored size: 496 Bytes

Contents

# SSH key
# $1: SSH key filename

if [ -f ~/.ssh/authorized_keys ]; then
  echo 'authorized_keys already created'
else
  if [ -f "$1" ]; then
    mkdir -p ~/.ssh
    cat $1 > ~/.ssh/authorized_keys
    rm $1
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
  else
    echo "The public key file is not found! Try the following command:"
    echo "cp ~/.ssh/$1 remote"
    echo "If the file name found in ~/.ssh is different from \"$1\", edit sunzi.yml as appropriate."
    exit 1
  fi
fi

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sunzi-0.4.4 lib/templates/create/remote/recipes/ssh_key.sh
sunzi-0.4.3 lib/templates/create/remote/recipes/ssh_key.sh
sunzi-0.4.2 lib/templates/create/remote/recipes/ssh_key.sh