From 05a9a73857730014d13d5b831bab1439fdb87e72 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 5 Aug 2014 19:09:03 -0700 Subject: [PATCH] use -f in shell script. --- slocked | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/slocked b/slocked index 26f1049..0f9fde1 100755 --- a/slocked +++ b/slocked @@ -14,8 +14,11 @@ if test -n "$ps"; then fi exec 2> /dev/null -pw=$1 -if test -z "$pw"; then - pw=$(cat ~/.slock_passwd) + +if test -z "$1"; then + exec slock -f ~/.slock_passwd + exit 1 fi -exec slock -p "$pw" + +exec slock -p "$1" +exit 1