From 4a6a6c6f886409fe164728a87f4ed87f2f768373 Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Wed, 19 Jun 2013 02:23:16 +0200 Subject: jsaccess: fix jstore add/rm --- jsaccess/jstore.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsaccess/jstore.sh b/jsaccess/jstore.sh index 72e9550..c7f0c04 100755 --- a/jsaccess/jstore.sh +++ b/jsaccess/jstore.sh @@ -182,7 +182,7 @@ action_add() { clear_name=`basename $clear_path` _pass_read _index_decrypt - if [ `egrep -c "^$clear_name$" $tmp` -ne 0 ]; then + if [ `egrep -c "^$clear_name .*$" $tmp` -ne 0 ]; then echo "File already present with this passphrase" clean_exit 1 fi @@ -201,13 +201,13 @@ action_rm() { clear_name=$1 _pass_read _index_decrypt - if [ `egrep -c "^$clear_name$" $tmp` -eq 0 ]; then + if [ `egrep -c "^$clear_name .*$" $tmp` -eq 0 ]; then echo "File does not exist for this passphrase" clean_exit 1 fi _file_rm $clear_name _index_decrypt - sed -i /^$clear_name$/d $tmp + sed -i /"^$clear_name .*$"/d $tmp _index_encrypt } -- cgit v1.2.3-59-g8ed1b