Files
vns/src/main/stage3.sns.sh
2016-02-15 16:23:01 -06:00

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.gpg.$EXT"
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
#==============================================================================