mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-18 14:46:37 +00:00
ref(ssh-pubkey): prefer ~ over $HOME for unquoted paths
This commit is contained in:
@@ -4,29 +4,29 @@ set -u
|
||||
|
||||
main() {
|
||||
|
||||
if [ ! -d "$HOME/.ssh" ]; then
|
||||
mkdir -p "$HOME/.ssh/"
|
||||
chmod 0700 "$HOME/.ssh/"
|
||||
if [ ! -d ~/.ssh ]; then
|
||||
mkdir -p ~/.ssh/
|
||||
chmod 0700 ~/.ssh/
|
||||
fi
|
||||
|
||||
if [ ! -f "$HOME/.ssh/config" ]; then
|
||||
if [ ! -f ~/.ssh/config ]; then
|
||||
# for the benefit of VSCode
|
||||
touch "$HOME/.ssh/config"
|
||||
chmod 0644 "$HOME/.ssh/config"
|
||||
touch ~/.ssh/config
|
||||
chmod 0644 ~/.ssh/config
|
||||
fi
|
||||
|
||||
if [ ! -f "$HOME/.ssh/authorized_keys" ]; then
|
||||
touch "$HOME/.ssh/authorized_keys"
|
||||
chmod 0600 "$HOME/.ssh/authorized_keys"
|
||||
if [ ! -f ~/.ssh/authorized_keys ]; then
|
||||
touch ~/.ssh/authorized_keys
|
||||
chmod 0600 ~/.ssh/authorized_keys
|
||||
fi
|
||||
|
||||
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
|
||||
ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
|
||||
if [ ! -f ~/.ssh/id_rsa ]; then
|
||||
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
|
||||
echo >&2 ""
|
||||
fi
|
||||
|
||||
if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
|
||||
ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
|
||||
if [ ! -f ~/.ssh/id_rsa.pub ]; then
|
||||
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
|
||||
echo >&2 ""
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user