diff options
author | Karel Kočí <cynerd@email.cz> | 2017-09-30 23:39:43 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-09-30 23:39:43 +0200 |
commit | 48120fbbb4f2b46e44c92d09f90a244717b1812d (patch) | |
tree | 306b325337faf355517e26a13b7a9b63f6e2c23f /local | |
parent | 3bf0736b56948274961db6cbdf6b28453fdffbdf (diff) | |
download | myconfigs-48120fbbb4f2b46e44c92d09f90a244717b1812d.tar.gz myconfigs-48120fbbb4f2b46e44c92d09f90a244717b1812d.tar.bz2 myconfigs-48120fbbb4f2b46e44c92d09f90a244717b1812d.zip |
Fix mpd and usbkey
Diffstat (limited to 'local')
-rwxr-xr-x | local/bin/usbkey | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/local/bin/usbkey b/local/bin/usbkey index 6d5115f..bab47df 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -121,12 +121,14 @@ op_ssh_generate() { op_ssh_import() { check_name check_mount || op_mount - if [ -f "$MOUNT_PATH/ssh/$NAME" ] && [ -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then + if [ ! -f "$MOUNT_PATH/ssh/$NAME" ] || [ ! -f "$MOUNT_PATH/ssh/$NAME.pub" ]; then echo "There is no key named $NAME" >&2 exit 1 fi cp "$MOUNT_PATH/ssh/$NAME" ~/.ssh/ cp "$MOUNT_PATH/ssh/$NAME.pub" ~/.ssh/ + chmod 600 ~/.ssh/"$NAME" + chmod 640 ~/.ssh/"$NAME.pub" echo "SSH key $NAME copied to local .ssh directory." >&2 } |