parent
b069d8f4ed
commit
af13ca8293
3 changed files with 0 additions and 75 deletions
|
@ -1,2 +0,0 @@
|
||||||
DROP DATABASE IF EXISTS fic2014;
|
|
||||||
CREATE DATABASE fic2014;
|
|
|
@ -1,68 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# Install FIC 2014 server
|
|
||||||
|
|
||||||
# Depends:
|
|
||||||
#
|
|
||||||
# nginx 1.4.3
|
|
||||||
# openssh 6.3p1-1
|
|
||||||
# iptables 1.4.19.1-1
|
|
||||||
# mariadb 5.5.33.a-1
|
|
||||||
|
|
||||||
# Exit values
|
|
||||||
# 0 Everything is good
|
|
||||||
# 1
|
|
||||||
# 2 File not found
|
|
||||||
# 3 Service not running
|
|
||||||
|
|
||||||
# By default the config dir is ..
|
|
||||||
DIR=${PWD%/*}
|
|
||||||
CONF="server.conf"
|
|
||||||
BASENAME=`basename $0`
|
|
||||||
FULL_INSTALL=false
|
|
||||||
|
|
||||||
display_help()
|
|
||||||
{
|
|
||||||
# By default install only config files
|
|
||||||
# --full: install package, enable services, install config
|
|
||||||
echo "Usage: $BASENAME [--full] (alpha|beta)"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
HTTP_DIR=""
|
|
||||||
DB_TYPE=""
|
|
||||||
DB_NAME=""
|
|
||||||
DB_USER=""
|
|
||||||
DB_PASS=""
|
|
||||||
|
|
||||||
parse_conf()
|
|
||||||
{
|
|
||||||
if ! [ -f $CONF ]; then
|
|
||||||
echo "The configuration file: " $CONF " not found"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
HTTP_DIR=$(sed -n 's/[ \t]*http_root[ \t]*=[ \t]*\(.*\)[ \t]*/\1/p' $CONF)
|
|
||||||
DB_TYPE=$(sed -n 's/[ \t]*db_type[ \t]*=[ \t]*\(.*\)[ \t]*/\1/p' $CONF)
|
|
||||||
DB_NAME=$(sed -n 's/[ \t]*db_name[ \t]*=[ \t]*\(.*\)[ \t]*/\1/p' $CONF)
|
|
||||||
DB_USER=$(sed -n 's/[ \t]*db_user[ \t]*=[ \t]*\(.*\)[ \t]*/\1/p' $CONF)
|
|
||||||
DB_PASS=$(sed -n 's/[ \t]*db_pass[ \t]*=[ \t]*\(.*\)[ \t]*/\1/p' $CONF)
|
|
||||||
}
|
|
||||||
|
|
||||||
INIT_DB="init_db.sql"
|
|
||||||
|
|
||||||
init_db()
|
|
||||||
{
|
|
||||||
if ! [ -f $INIT_DB ]; then
|
|
||||||
echo "The configuration file " $INIT_DB " not found"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! [ -S /var/run/mysqld/mysqld.sock ]; then
|
|
||||||
echo "The mysqld service is not running"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
[ $# -ne 1 ] && display_help
|
|
||||||
|
|
||||||
parse_conf
|
|
|
@ -1,5 +0,0 @@
|
||||||
http_root=/srv/http/fic2014-server
|
|
||||||
db_type=mysql
|
|
||||||
db_name=fic
|
|
||||||
db_user=toto
|
|
||||||
db_pass=toto42
|
|
Reference in a new issue