diff --git a/99-final/phpfiles.tar.gz b/99-final/phpfiles.tar.gz new file mode 100644 index 0000000..173900d Binary files /dev/null and b/99-final/phpfiles.tar.gz differ diff --git a/99-final/sitebuilder.sh b/99-final/sitebuilder.sh new file mode 100644 index 0000000..20ac902 --- /dev/null +++ b/99-final/sitebuilder.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: target/tardiba/99-final/sitebuilder.sh +# Copyright (C) 2007 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +SITE_ROOT="$1" +SITE_DB="$2" +DB_IP="$3" +DB_PORT="$4" + +lighttpd_config="/etc/opt/lighttpd/lighttpd.conf" +DOC_ROOT=`grep 'simple-vhost.server-root' $lighttpd_config | awk {'print $3'} | sed 's,\",,g'` +TEMPLATE="/usr/share/sitebuilder/phpfiles.tar.gz" + +if [ "$SITE_ROOT" ]; then + if [ ! -d $DOC_ROOT/$SITE_ROOT ]; then + mkdir -p $DOC_ROOT/$SITE_ROOT/pages + cd $DOC_ROOT/$SITE_ROOT/pages + tar xzvf $TEMPLATE + db_to_replace=`grep '^\$dbname' $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php | awk {'print $3'} | sed s,\",,g` + sed -e "s,$db_to_replace,$SITE_DB,g" -i $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php + ip_to_replace=`grep '^\$host' $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php | awk {'print $3'} | sed s,\",,g` + sed -e "s,$ip_to_replace,$DB_IP,g" -i $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php + port_to_replace=`grep '^\$dbname' $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php | awk {'print $3'} | sed s,\",,g` + sed -e "s,$ip_to_replace,$DB_IP,g" -i $DOC_ROOT/$SITE_ROOT/pages/dbconnection.php + else + exit 1; + fi +fi + +exit 0; diff --git a/99-final/sshadminpg.cfg b/99-final/sshadminpg.cfg new file mode 100644 index 0000000..a2db758 --- /dev/null +++ b/99-final/sshadminpg.cfg @@ -0,0 +1,6 @@ +pathDumpDir = /var/opt/postgresql/data/dumps/ +pathPGbinaries = /opt/postgresql/bin/ +SUpostgres = su - postgres -c +cmdMakeDumpDir = /opt/postgresql/bin/pg_backup.sh configtest +cmdPGrestart = sv h /service/postgresql +cmdPGstatus = sv -l /service/postgresql