From 74c084cd1c29d339310a457e2e61d473a231b3de Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 10 Oct 2011 08:06:14 -0500 Subject: [PATCH] Add option not to run bash after execing stack.sh If stack.sh is run as root, it execs stack.sh as stack, but also runs bash after doing so to provide a prompt as the stack user. In unattended installations this isn't desired as it will prevent the original job from completing. This change adds a paremeter "SHELL_AFTER_RUN" which can be set to "no" to prevent the final invocation of bash. --- stack.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 6c9f43e..f6bf534 100755 --- a/stack.sh +++ b/stack.sh @@ -69,7 +69,11 @@ if [[ $EUID -eq 0 ]]; then chown -R stack /home/stack/$THIS_DIR echo "Running the script as stack in 3 seconds..." sleep 3 - exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh; bash" stack + if [[ "$SHELL_AFTER_RUN" != "no" ]]; then + exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh; bash" stack + else + exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh" stack + fi exit 0 fi