diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-16 06:34:02 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-16 06:34:40 +0200 |
commit | d204513a3eed40976c6212b56bb674cc55811d87 (patch) | |
tree | f25eff10f184deb88a49b5648b84e39ea7dadeab /bin | |
parent | b02d85f46978f4e87e71ab54edbd19e361cc4e77 (diff) |
don't continue if key does not exist
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/guiscripts/keyadd | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 87d844d..3f0baa4 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -10,6 +10,8 @@ key="$(find ~/.ssh -iname "*.pub" | $MENUCMD)" die "key: $key" +test ! -f "$HOME/.ssh/$key" && exit 1 + HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') if ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" |