Page MenuHomeDevCentral

phpbb.sh
No OneTemporary

phpbb.sh

#!/bin/sh
# -------------------------------------------------------------
# PaaS Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2018-03-27
# License: Trivial work, not eligible to copyright
# Source file: roles/paas-docker/wrappers/files/phpbb.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
# -------------------------------------------------------------
# Configuration required by Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MYSQL_CONTAINER=phpbb_db
MYSQL_IMAGE=nasqueron/mysql
# -------------------------------------------------------------
# Helper methods
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
getcommandname() {
basename "$0"
}
usage() {
echo "Usage: $(getcommandname) <command>"
exit 1
}
unknown_command() {
echo "$(getcommandname): $COMMAND: unknown command"
usage
}
# -------------------------------------------------------------
# Commands
#
# :: phpbb storage: connects to MySQL database
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
phpbb_storage() {
docker run -it --rm --link $MYSQL_CONTAINER:mysql $MYSQL_IMAGE \
sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
}
# -------------------------------------------------------------
# Check arguments
#
# $1: wiki name (database name or alias)
# $2: script to call
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ $# -lt 1 ]; then
usage
fi
COMMAND=$1
shift 1
# -------------------------------------------------------------
# Run command
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$COMMAND" = "storage" ]; then
phpbb_storage
else
unknown_command
fi

File Metadata

Mime Type
text/x-shellscript
Expires
Tue, May 13, 16:50 (1 d, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2561783
Default Alt Text
phpbb.sh (2 KB)

Event Timeline