From fcc6c6c5b50fca9fdeea262f4c97aede95b067ef Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Jun 2018 15:37:31 -0600 Subject: [PATCH] Quiet down and stop speaking nonsense! --- bin/telebit.js | 37 +++++++++++++++++++++---------------- usr/share/install_helper.sh | 8 ++++---- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/bin/telebit.js b/bin/telebit.js index 94f0199..bac9fcd 100755 --- a/bin/telebit.js +++ b/bin/telebit.js @@ -118,11 +118,14 @@ function askForConfig(answers, mainCb) { function askEmail(cb) { if (answers.email) { cb(); return; } console.info(""); + console.info("Welcome!"); console.info(""); - console.info("Telebit uses Greenlock for free automated ssl through Let's Encrypt."); + console.info("By using Telebit you agree to:"); console.info(""); - console.info("To accept the Terms of Service for Telebit, Greenlock and Let's Encrypt,"); - console.info("please enter your email."); + console.info(" [x] Accept the Telebitâ„¢ terms of service"); + console.info(" [x] Accept the Let's Encryptâ„¢ terms of service"); + console.info(""); + console.info("Enter your email to agree and create your account:"); console.info(""); // TODO attempt to read email from npmrc or the like? rl.question('email: ', function (email) { @@ -561,19 +564,21 @@ function parseConfig(err, text) { // need just a little time to let the grants occur setTimeout(function () { - utils.putConfig('list', [], function (err) { - if (err) { console.error(err); return; } - console.log("Success"); - // workaround for https://github.com/nodejs/node/issues/21319 - if (answers._useTty) { - setTimeout(function () { - console.log(); - console.log("Press any key to continue..."); - console.log(); - process.exit(0); - }, 0.5 * 1000); - } - // end workaround + utils.putConfig('enable', [], function () { + utils.putConfig('list', [], function (err) { + if (err) { console.error(err); return; } + console.log("Success"); + // workaround for https://github.com/nodejs/node/issues/21319 + if (answers._useTty) { + setTimeout(function () { + console.log(); + console.log("Press any key to continue..."); + console.log(); + process.exit(0); + }, 0.5 * 1000); + } + // end workaround + }); }); }, 1 * 1000); diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index bb1fe0e..6172783 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -428,7 +428,9 @@ sleep 1 ############################### # Actually Launch the Service # ############################### -echo "" +if [ -n "${TELEBIT_DEBUG}" ]; then + echo "" +fi if [ "launchd" == "$my_system_launcher" ]; then if [ "yes" == "$TELEBIT_USERSPACE" ]; then @@ -520,7 +522,5 @@ if [ -n "${TELEBIT_DEBUG}" ]; then fi sleep 0.25 +echo "" $TELEBIT_REAL_PATH/bin/node $TELEBIT_REAL_PATH/bin/telebit.js init --tty - -$TELEBIT_REAL_PATH/bin/node $TELEBIT_REAL_PATH/bin/telebit.js enable -