From 48120fbbb4f2b46e44c92d09f90a244717b1812d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 30 Sep 2017 23:39:43 +0200 Subject: Fix mpd and usbkey --- local/bin/usbkey | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'local/bin') 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 } -- cgit v1.2.3