From eeaf266a7962fd1ee751288bae38a0710b3a6771 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 14 Jun 2012 09:11:38 -0500 Subject: [PATCH] Skip screen if not present Change-Id: I018249c415fa91ca6461a8f9d236767aa57a8fbd --- unstack.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unstack.sh b/unstack.sh index 7de0d749e5..341270d602 100755 --- a/unstack.sh +++ b/unstack.sh @@ -25,9 +25,12 @@ if [[ "$1" == "--all" ]]; then fi # Shut down devstack's screen to get the bulk of OpenStack services in one shot -SESSION=$(screen -ls | grep "[0-9].stack" | awk '{ print $1 }') -if [[ -n "$SESSION" ]]; then - screen -X -S $SESSION quit +SCREEN=$(which screen) +if [[ -n "$SCREEN" ]]; then + SESSION=$(screen -ls | awk '/[0-9].stack/ { print $1 }') + if [[ -n "$SESSION" ]]; then + screen -X -S $SESSION quit + fi fi # Swift runs daemons