Abort osbash.sh if executed in Windows environment

The osbash host-side shell scripts do not work in a Windows environment.
We create and support separate Windows batch files for that purpose.

With this patch, users trying to run osbash in cygwin or mingw get a
warning before the script aborts.

Closes-Bug: #1625562
Change-Id: I60d245e45c80190645c652c2feb87b1dfd0bbc7f
This commit is contained in:
Roger Luethi 2016-10-01 09:52:38 +02:00
parent e66208e795
commit 180e43354d

View File

@ -8,6 +8,14 @@ trap 'kill -- -$$' SIGINT
TOP_DIR=$(cd "$(dirname "$0")" && pwd)
# Abort for Windows environment before sourcing scripts that may result
# in other errors.
if uname | grep -i -e "cygwin" -e "mingw"; then
echo "Running osbash.sh in Windows is not supported. Instead, use the"
echo "Windows batch scripts in the wbatch directory."
exit 1
fi
source "$TOP_DIR/config/localrc"
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/openstack"