You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
472 B
18 lines
472 B
2 years ago
|
#!/usr/bin/env bash
|
||
|
set -e
|
||
|
|
||
2 years ago
|
# don't require ssh key setup if user is root
|
||
|
if [ "$EUID" -eq 0 ]; then
|
||
|
return
|
||
|
fi
|
||
|
|
||
2 years ago
|
# set 0600 permissions on config file
|
||
|
# (setting permissions on a symlink does nothing; see chmod(1))
|
||
2 years ago
|
chmod 0600 "${DIR}/src/.ssh/config"
|
||
2 years ago
|
|
||
|
# prompt to create key if none exists
|
||
|
if [[ "$(find ~/.ssh -maxdepth 1 -type f -name '*.pub' | wc -l)" == 0 ]]; then
|
||
|
echo 'No SSH keys found; creating one now.'
|
||
|
ssh-keygen -t ed25519 -C 'nightfirecat@nightfirec.at'
|
||
|
fi
|