sshcopyid option: exit if `ssh-add -L` fails to execute
authorMichael Prokop <mika@grml.org>
Sat, 2 Mar 2019 09:40:56 +0000 (10:40 +0100)
committerMichael Prokop <mika@grml.org>
Sat, 2 Mar 2019 09:47:48 +0000 (10:47 +0100)
commitde2ad0f7b35c8e6774e829d9fe15adff50d9844e
treefcfb3d9013910f88d5b04b02788542b269c5ce2b
parent6359370c21819973a396b6277bcf3f04b25aa565
sshcopyid option: exit if `ssh-add -L` fails to execute

If a user requested the --sshcopyid option then it's supposed
to be run successfully, otherwise it might leave an inaccessible
system, so exit with error if execution of `ssh-add -L` fails.

While at it:

* simplify code (no need for $RC)
* don't fail if directory /root/.ssh exists already
* append keys to possibly existing /root/.ssh/authorized_keys
  file, instead of overwriting it
grml-debootstrap