Continued work on loosening note definition; added framework for color in errors.

This commit is contained in:
Jon-William Lewis
2016-02-15 00:55:29 -06:00
parent 2b77e325ae
commit faab86dff2
4 changed files with 73 additions and 73 deletions

View File

@@ -1,39 +1,36 @@
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Entry Point
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#==============================================================================
# Stage 1: Read Configuration / Verify Integrity
#==============================================================================
#==============================================================================
# Stage 1: Read Configuration / Verify Integrity
#==============================================================================
if [ -r "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
init_store
source "$CONFIG_FILE"
fi
if [ -r "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
init_store
source "$CONFIG_FILE"
fi
verify_store
verify_store
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ -z "$PUBKEY" ]; then
ERR_NO_KEY="TRUE"
ENCRYPTION="FALSE"
fi
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"; }
fi
command -v gpg >/dev/null 2>&1 ||\
{ ERR_NO_GPG="TRUE"; ENCRYPTION="FALSE"; }
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ ! -d "$ROOT_DIR"/tmp ]; then
mkdir -p "$ROOT_DIR"/tmp
fi
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ ! -d "$ROOT_DIR"/tmp ]; then
mkdir -p "$ROOT_DIR"/tmp
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
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