expand notesinsert to read password only from file
This commit is contained in:
17
action.sh
17
action.sh
@@ -152,9 +152,22 @@ function notesdelete { # $1=$USER
|
||||
function notesinsert {
|
||||
# Update datasheet (add new entry in Email section)
|
||||
USER=$1
|
||||
PASS=$2
|
||||
PASSFILE=$2
|
||||
|
||||
sed -i "/$TAIL/i User: $USER\nPass: $PASS\n" $NOTES
|
||||
# Create temporary file from $PASSFILE
|
||||
sed -E 's/(.*)/User: $USER\nPass: \1/' $PASSFILE > .$PASSFILE.tmp
|
||||
|
||||
# Insert this edited file into the datasheet
|
||||
sed -i "/$TAIL/ {
|
||||
h
|
||||
r .$PASSFILE.tmp
|
||||
g
|
||||
N
|
||||
}" $NOTES
|
||||
|
||||
rm .$PASSFILE.tmp
|
||||
|
||||
# sed -i "/$TAIL/i User: $USER\nPass: $PASS\n" $NOTES
|
||||
}
|
||||
|
||||
## FIRST CHECKS
|
||||
|
||||
Reference in New Issue
Block a user