aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-06-19 02:23:16 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-06-19 02:23:16 +0200
commit4a6a6c6f886409fe164728a87f4ed87f2f768373 (patch)
treec3ae78eb85b40573eb6ab2aefd85822f657a47cc
parentjsaccess: TODO-- (diff)
downloadlaurent-tools-4a6a6c6f886409fe164728a87f4ed87f2f768373.tar.xz
laurent-tools-4a6a6c6f886409fe164728a87f4ed87f2f768373.zip
jsaccess: fix jstore add/rm
-rwxr-xr-xjsaccess/jstore.sh6
1 files 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
}