Formatting changes

This commit is contained in:
Jon-William Lewis
2016-02-10 23:34:49 -06:00
parent be3871f859
commit 856b14242c
14 changed files with 267 additions and 282 deletions

View File

@@ -1,41 +1,41 @@
#==============================================================================
# Section: Configuration / Stage 1
#==============================================================================
if [ -r "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
create_sns_root
source "$CONFIG_FILE"
fi
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Entry Point
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#==============================================================================
# Stage 1: Read Configuration / Verify Integrity
#==============================================================================
if [ -r "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
init_store
source "$CONFIG_FILE"
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ -z "$PUBKEY" ]; then
ERR_NO_KEY="TRUE"
ENCRYPTION="FALSE"
fi
verify_store
command -v gpg >/dev/null 2>&1 ||\
{ ERR_NO_GPG="TRUE"; ENCRYPTION="FALSE"; }
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ -z "$PUBKEY" ]; then
ERR_NO_KEY="TRUE"
ENCRYPTION="FALSE"
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
PROD_STR="Simple Note System (Encryption Enabled)"
if [ ! -d "$ROOT_DIR"/tmp ]; then
mkdir -p "$ROOT_DIR"/tmp
fi
fi
command -v gpg >/dev/null 2>&1 ||\
{ ERR_NO_GPG="TRUE"; ENCRYPTION="FALSE"; }
fi
echo "$PROD_STR, $VER_STR"
if [ "$ENCRYPTION" == "TRUE" ]; then
PROD_STR="Simple Note System (Encryption Enabled)"
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
echo "$PROD_STR, $VER_STR"
#==============================================================================
# End Section: Configuration / Stage 1
#==============================================================================
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