Set ACCOUNT_KEY_PATH and ACCOUNT_EMAIL in _initconf()

this enables the following one liner for initial
configuration at install time, which would mean that most
users would never need to touch their account.conf manually:

ACCOUNT_CONF_PATH=/path/to/account.conf ACCOUNT_KEY_PATH=/path/to/account.key ACCOUNT_EMAIL=some@valid.email ./le.sh install
This commit is contained in:
Fabian Grünbichler 2016-04-08 13:24:14 +02:00
parent 6cb415f57e
commit 3ac86cdec5

7
le.sh
View File

@ -1609,6 +1609,13 @@ USER_AGENT=\"le.sh client: $PROJECT\"
" > $ACCOUNT_CONF_PATH
fi
if [ -n "$ACCOUNT_KEY_PATH" ]; then
_sed_i "s/^#ACCOUNT_KEY_PATH=.*$/ACCOUNT_KEY_PATH=\"${ACCOUNT_KEY_PATH//\//\\\/}\"/g" "$ACCOUNT_CONF_PATH"
fi
if [ -n "$ACCOUNT_EMAIL" ]; then
_sed_i "s/^#ACCOUNT_EMAIL=.*$/ACCOUNT_EMAIL=\"${ACCOUNT_EMAIL//\//\\\/}\"/g" "$ACCOUNT_CONF_PATH"
fi
}
_precheck() {