Variable name reworking; laid foundation for GPG encryption (instead of OpenSSL)

This commit is contained in:
Jon-William Lewis
2016-01-25 17:20:05 -06:00
parent 908b93242c
commit 6a21731082
12 changed files with 180 additions and 102 deletions

View File

@@ -1,30 +1,33 @@
#==============================================================================
# Section: Configuration
# Section: Configuration / Stage 1
#==============================================================================
if [ -r "$CONFIGURATION" ]; then
source "$CONFIGURATION"
if [ -r "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
w_conf
source "$CONFIGURATION"
create_sns_root
source "$CONFIG_FILE"
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
if [ -z "$ENC_KEY" ]; then
ERR_NO_KEY="TRUE"
ENCRYPTION="FALSE"
fi
command -v openssl >/dev/null 2>&1 || { ERR_NO_SSL="TRUE"; ENCRYPTION="FALSE"; }
if [ -z "$PUBKEY" ]; then
ERR_NO_KEY="TRUE"
ENCRYPTION="FALSE"
fi
command -v openssl >/dev/null 2>&1 ||\
{ ERR_NO_SSL="TRUE"; ENCRYPTION="FALSE"; }
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
PROD_STR="Simple Note System (Encryption Enabled)"
EXT="$EXT"
if [ ! -d "$BASEDIR"/tmp ]; then
mkdir -p "$BASEDIR"/tmp
fi
PROD_STR="Simple Note System (Encryption Enabled)"
EXT="$EXT".gpg
if [ ! -d "$BASE_DIR"/tmp ]; then
mkdir -p "$BASE_DIR"/tmp
fi
fi
echo "$PROD_STR, $VER_STR"
if [ -n "$ERR_NO_SSL" ]; then
echo >&2 " Warning: OpenSSL not installed. Encryption disabled."
fi
@@ -37,5 +40,5 @@ pause
fi
#==============================================================================
# End Section: Configuration
# End Section: Configuration / Stage 1
#==============================================================================