From 3ac86cdec50547f0d211cbdd5f8fcb3a6c1cb204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 8 Apr 2016 13:24:14 +0200 Subject: [PATCH] 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 --- le.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/le.sh b/le.sh index c1fa62f2..e4e988d7 100755 --- a/le.sh +++ b/le.sh @@ -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() {