[IMP] Launch script: help to use another configuration file to launch

multiple instance with different configuration of Gissmo
This commit is contained in:
Olivier DOSSMANN 2016-01-14 11:24:08 +01:00
parent d043040b91
commit 437bc2cdc3

View File

@ -15,7 +15,10 @@ POSTGRES_VERSION="9.5"
GISSMO_DOCKER_NAME="gissmo"
## User
if test -z "$GISSMO_CFG"; then
# No Gissmo Launcher configuration file given. Search one.
CONFIG_FILENAME="config"
# first in XDG directory, otherwise ~/.config one.
if test -z $XDG_CONFIG_HOME; then
CONFIG_DEFAULT_DIR="${HOME}/.config/gissmo"
else
@ -29,6 +32,14 @@ if ! test -f ${CONFIG_FILE}; then
exit 1
fi
fi
else
# Gissmo Launcher configuration file is given! Check it.
CONFIG_FILE=$GISSMO_CFG
if ! test -f $CONFIG_FILE; then
echo "Configuration file not found: ${CONFIG_FILE}"
exit 1
fi
fi
. ${CONFIG_FILE} || exit 1
## Composed
@ -89,6 +100,10 @@ show_help() {
echo -e " $PROGRAM stop"
echo -e " $PROGRAM start python manage.py shell"
echo -e " $PROGRAM stop"
echo ""
echo -e "If GISSMO_CFG used, you can specify another configuration file. Example:"
echo ""
echo -e " GISSMO_CFG=~/new_config $PROGRAM"
# TODO: Add clean() command to STOP and DELETE Gissmo Docker container
# TODO: Add clean_db() command to STOP and DELETE postgreSQL Docker container
# TODO: Add clean_all() command that makes clean() and clean_db()