31 lines
1.2 KiB
Bash
31 lines
1.2 KiB
Bash
#==============================================================================
|
|
# Section: Actions / Stage 3
|
|
#==============================================================================
|
|
# Default behavior
|
|
# If no operation was specified, print help and exit on ERR_NO_OP
|
|
if [ "$OP" != "TRUE" ]; then
|
|
help; exit 20
|
|
fi
|
|
# All options not requiring a note to be specified have been dealt
|
|
# with; if one isn't specified, exit on ERR_NO_NOTE.
|
|
if [ -z "$NOTE" ]; then
|
|
printf " $RED_COLOR!$RESET_COLOR %s\n" "No note specified."
|
|
exit 30
|
|
fi
|
|
|
|
if [ "$ENCRYPTION" == "TRUE" ]; then
|
|
SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename
|
|
readonly NOTE="$NOTE.$EXT.gpg"
|
|
else
|
|
readonly NOTE="$NOTE.$EXT"
|
|
fi
|
|
|
|
if [ "$LIST" == "TRUE" ]; then list ; exit 0; fi
|
|
if [ "$PRINT" == "TRUE" ]; then print ; exit 0; fi
|
|
if [ "$DELETE" == "TRUE" ]; then delete; exit 0; fi
|
|
if [ "$CREATE" == "TRUE" ]; then create; fi
|
|
if [ "$EDIT" == "TRUE" ]; then edit ; fi
|
|
#==============================================================================
|
|
# End Section: Actions / Stage 3
|
|
#==============================================================================
|