devstack/rejoin-stack.sh
Derrick J. Wippler aaa0dbb2e7 Restart openstack services after running stack.sh
* Added screen_rc function in stack.sh to save started services to stack-screenrc file
* Added rejoin-stack.sh to rejoin the current screen session or start a new session

Change-Id: I381a7832bc8a107bfbd51c5ecfbd2e9134cf0a0a
blueprint: restart-services
2012-02-23 12:08:43 -06:00

19 lines
506 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`
# 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
fi
echo "Couldn't find $TOP_DIR/stack-screenrc file; have you run stack.sh yet?"
exit 1