Sweeping refinements and formatting changes
This commit is contained in:
@@ -4,33 +4,20 @@
|
||||
|
||||
if [ -r "$CONFIG_FILE" ]; then
|
||||
source "$CONFIG_FILE"
|
||||
verify_store
|
||||
else
|
||||
init_store
|
||||
source "$CONFIG_FILE"
|
||||
fi
|
||||
|
||||
verify_store
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then
|
||||
if [ -z "$PUBKEY" ]; then
|
||||
ERR_NO_KEY="TRUE"
|
||||
ENCRYPTION="FALSE"
|
||||
fi
|
||||
|
||||
command -v gpg >/dev/null 2>&1 ||\
|
||||
{ ERR_NO_GPG="TRUE"; ENCRYPTION="FALSE"; }
|
||||
>&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\
|
||||
"Configuration note found. Please run sns -i."
|
||||
fi
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then
|
||||
if [ ! -d "$ROOT_DIR"/tmp ]; then
|
||||
mkdir -p "$ROOT_DIR"/tmp
|
||||
if [ ! -r $(which gpg) ]; then
|
||||
>&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\
|
||||
"Encryption was specified, but GPG is not installed."
|
||||
exit 100
|
||||
elif [ -z "$PUBKEY" ]; then
|
||||
>&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\
|
||||
"No GPG recipient was provided in $CONFIG_FILE. "
|
||||
exit 110
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$ERR_NO_GPG" ]; then
|
||||
>&2 echo " Error: Encryption was specified, but GPG is not installed."
|
||||
exit 100
|
||||
elif [ -n "$ERR_NO_KEY" ]; then
|
||||
>&2 echo " Error: No GPG recipient was provided in $CONFIG_FILE. "
|
||||
exit 110
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user