From c1ccd22531d551159061754a5d1fe8e76076b849 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 21 Sep 2014 16:56:28 -0400 Subject: [PATCH] put a start script at /usr/local/bin/mailinabox --- setup/preflight.sh | 2 +- setup/questions.sh | 2 +- setup/start.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/setup/preflight.sh b/setup/preflight.sh index afa43027..be584221 100644 --- a/setup/preflight.sh +++ b/setup/preflight.sh @@ -2,7 +2,7 @@ if [[ $EUID -ne 0 ]]; then echo "This script must be run as root. Please re-run like this:" echo - echo "sudo setup/start.sh" + echo "sudo $0" echo exit fi diff --git a/setup/questions.sh b/setup/questions.sh index 40b57baf..339b7ec2 100644 --- a/setup/questions.sh +++ b/setup/questions.sh @@ -8,7 +8,7 @@ if [ -z "$NONINTERACTIVE" ]; then message_box "Mail-in-a-Box Installation" \ "Hello and thanks for deploying a Mail-in-a-Box! \n\nI'm going to ask you a few questions. - \n\nTo change your answers later, just re-run this script." + \n\nTo change your answers later, just run 'sudo mailinabox' from the command line." fi # The box needs a name. diff --git a/setup/start.sh b/setup/start.sh index aba6a1e3..aa2cbe4e 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -21,6 +21,15 @@ if [ -f /etc/mailinabox.conf ]; then rm -f /tmp/mailinabox.prev.conf fi +# Put a start script in a global location. We tell the user to run 'mailinabox' +# in the first dialog prompt, so we should do this before that starts. +cat > /usr/local/bin/mailinabox << EOF; +#!/bin/bash +cd `pwd` +source setup/start.sh +EOF +chmod +x /usr/local/bin/mailinabox + # Ask the user for the PRIMARY_HOSTNAME, PUBLIC_IP, PUBLIC_IPV6, and CSR_COUNTRY # if values have not already been set in environment variables. When running # non-interactively, be sure to set values for all!