From fe64e45a561fc598e7133cc5c9054693bc78d4d0 Mon Sep 17 00:00:00 2001 From: jash Date: Thu, 6 Dec 2018 18:26:04 +0100 Subject: [PATCH] added autostart command line switch -s --- dist/setup.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dist/setup.sh b/dist/setup.sh index eaaacb4..9550e66 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -591,6 +591,7 @@ RECREATE=0 TRACING=1 ALWAYSYES=0 SUDO_REQUIRED=0 +AUTOSTART=0 # trap ctrl-c and call ctrl_c() trap ctrl_c INT @@ -600,7 +601,7 @@ function ctrl_c() { exit } -while getopts ":cirhy" opt; do +while getopts ":cirhys" opt; do case $opt in r) RECREATE=1 @@ -614,8 +615,15 @@ while getopts ":cirhy" opt; do y) ALWAYSYES=1 ;; + s) + AUTOSTART=1 + ;; h) - echo "Use -c to configure and -i to install or -r to recreate from config.json." >&2 + echo "-c configure" >&2 + echo "-r recreate" >&2 + echo "-i install" >&2 + echo "-y assume yes to all questions" >&2 + echo "-s autostart" >&2 exit ;; \?) @@ -651,4 +659,9 @@ if [[ $INSTALL == 1 ]]; then modify_permissions fi -cowsay +if [[ $AUTOSTART == 1 ]]; then + exec ./start.sh +else + cowsay +fi +