1
Fork 0

Modify save-ssh-key function

This commit is contained in:
Hadeed 2024-04-14 08:02:45 +05:00
parent 5a6b9f03a0
commit fc87f5e7fc

View file

@ -2,8 +2,14 @@ function cc() python -c "from math import *; print($*)"
function mkcd() mkdir -p -- $1 && cd -- $1 function mkcd() mkdir -p -- $1 && cd -- $1
function save-ssh-key() { function save-ssh-key() {
mkdir -p "$HOME/.ssh"
chmod 700 "$HOME/.ssh"
mv "$1" "$HOME/.ssh/${1}_${2}" mv "$1" "$HOME/.ssh/${1}_${2}"
mv "$1.pub" "$HOME/.ssh/${1}_${2}.pub"
if [ -e "$1.pub" ]; then
mv -n "$1.pub" "$HOME/.ssh/${1}_${2}.pub"
fi
} }
function eik() { function eik() {