sane-private-unlock: fix perms
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash -p coreutils -p systemdMinimal
|
||||
|
||||
umask 027
|
||||
|
||||
if ! systemctl is-active private-storage.target > /dev/null; then
|
||||
echo "unable to access encrypted data store."
|
||||
echo "unlock it now or cancel with Ctrl+C."
|
||||
@@ -10,7 +12,7 @@ while ! systemctl is-active private-storage.target > /dev/null; do
|
||||
# see: <https://stackoverflow.com/a/2654096>
|
||||
IFS= read -s -r -p "password: " line
|
||||
echo
|
||||
if [[ "$?" -eq 0 ]]; then
|
||||
if [[ "$?" -eq 0 && -n "$line" ]]; then
|
||||
echo -n "$line" > /run/gocryptfs/private.key
|
||||
# give time for the store to be unlocked
|
||||
timeout 3s systemctl start private-storage.target
|
||||
|
Reference in New Issue
Block a user