devstack/rejoin-stack.sh
Doug Hellmann 88317adc0a Source functions in rejoin-stack.sh
stackrc loads localrc and localrc can use functions
like enable_service and disable_service. Make sure
the functions are defined before loading stackrc.

Change-Id: Ied7bbe0d228f252902cc491b8db0738c5071f06b
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-06-06 15:42:13 -04:00

25 lines
654 B
Bash
Executable File

#! /usr/bin/env bash
# This script rejoins an existing screen, or re-creates a
# screen session from a previous run of stack.sh.
TOP_DIR=`dirname $0`
# Import common functions in case the localrc (loaded via stackrc)
# uses them.
source $TOP_DIR/functions
source $TOP_DIR/stackrc
# if screenrc exists, run screen
if [[ -e $TOP_DIR/stack-screenrc ]]; then
if screen -ls | egrep -q "[0-9].stack"; then
echo "Attaching to already started screen session.."
exec screen -r stack
fi
exec screen -c $TOP_DIR/stack-screenrc -S $SCREEN_NAME
fi
echo "Couldn't find $TOP_DIR/stack-screenrc file; have you run stack.sh yet?"
exit 1