From 5c6f1af52cacb8e5416deadf030b2654ca66fc85 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Nov 2022 10:24:24 -0500 Subject: [PATCH 1/2] Fix typo in stderr redirection --- gocrypt.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gocrypt.bash b/gocrypt.bash index 2d05245..81f2598 100755 --- a/gocrypt.bash +++ b/gocrypt.bash @@ -52,7 +52,7 @@ gocrypt_spawn_close_task() { local task_name="$(gocrypt_unique_task_identifier)" # Cancel any previous task that might be present - systemctl --user stop "$task_name.timer" > /dev/null 2>1 + systemctl --user stop "$task_name.timer" > /dev/null 2>&1 # Create a new task systemd-run --user --on-active=$gocrypt_close_timeout --unit="$task_name" \ From 31e65661a5bf4efd81614671fc8619bcd6d06e80 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Nov 2022 10:27:56 -0500 Subject: [PATCH 2/2] Abort if open failed --- gocrypt.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gocrypt.bash b/gocrypt.bash index 81f2598..c6f8608 100755 --- a/gocrypt.bash +++ b/gocrypt.bash @@ -147,7 +147,7 @@ gocrypt_open() { fi fi - gocryptfs -passfile /dev/stdin "$gocrypt_dir" "$gocrypt_dec_dir" <<< "$gocrypt_passwd" + gocryptfs -passfile /dev/stdin "$gocrypt_dir" "$gocrypt_dec_dir" <<< "$gocrypt_passwd" || gocrypt_die "Unable to decrypt" gocrypt_spawn_close_task }