Files
vns/init/stage1.sns.sh
Jon-William Lewis a0ad2e7d48 Alpha 3
Testing:
Print function works
2015-03-18 14:53:05 -05:00

41 lines
1.1 KiB
Bash

#==============================================================================
# Section: Configuration
#==============================================================================
if [ -r $HOME/.sns/sns.conf ]; then
source $HOME/.sns/sns.conf
else
init_default_config
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"; }
fi
if [ "$ENCRYPTION" == "TRUE" ]; then
PROD_STR="Simple Note System (Encryption Enabled)"
EXT="$EXT.enc"
if [ ! -d ~/.sns/tmp ]; then
mkdir -p ~/.sns/tmp
fi
fi
echo "$PROD_STR, $VER_STR"
if [ -n "$ERR_NO_SSL" ]; then
echo >&2 " Warning: OpenSSL not installed. Encryption disabled."
fi
if [ -n "$ERR_NO_KEY" ]; then
echo " Warning: No encryption key was provided. Encryption disabled."
fi
if [ -n "$ERR_NO_SSL" -o -n "$ERR_NO_KEY" ]; then
pause
fi
#==============================================================================
# End Section: Read Configuration
#==============================================================================