summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2010-11-15 18:13:06 +0000
committerramon <ramongomez@us.es>2010-11-15 18:13:06 +0000
commitbf41d13ab83f6556a950c348473352a3bd3eab9e (patch)
tree06b0696d795ecf848c61e53d6f87375220bcd423
parent3f9764a3d2eee515182a9aef28ee438f6d86acc6 (diff)
Se modifican los programas de instalación y desinstalación para procesar los ficheros de configuración, permitiendo personalizar el acceso a la base de datos.
Se definen cadenas normalizadas para procesar los ficheros de configuración con los parámetros de acceso a la base de datos. git-svn-id: https://opengnsys.es/svn/trunk@1345 a21b9725-9963-47de-94b9-378ad31fedc9
-rw-r--r--admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg6
-rw-r--r--admin/Sources/Services/ogAdmServer/ogAdmServer.cfg6
-rw-r--r--admin/Sources/Services/opengnsys.default4
-rw-r--r--admin/WebConsole/controlacceso.php2
-rwxr-xr-xinstaller/opengnsys_installer.sh6
-rwxr-xr-xinstaller/opengnsys_uninstall.sh23
6 files changed, 27 insertions, 20 deletions
diff --git a/admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg b/admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg
index b21c91ae..20126d35 100644
--- a/admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg
+++ b/admin/Sources/Services/ogAdmAgent/ogAdmAgent.cfg
@@ -1,7 +1,7 @@
ServidorAdm=SERVERIP
PUERTO=2008
-USUARIO=usuog
-PASSWORD=passusuog
+USUARIO=DBUSER
+PASSWORD=DBPASSWORD
datasource=localhost
-CATALOG=ogAdmBD
+CATALOG=DATABASE
diff --git a/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg b/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg
index 9d88328c..9273952f 100644
--- a/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg
+++ b/admin/Sources/Services/ogAdmServer/ogAdmServer.cfg
@@ -1,6 +1,6 @@
ServidorAdm=SERVERIP
PUERTO=2008
-USUARIO=usuog
-PASSWORD=passusuog
+USUARIO=DBUSER
+PASSWORD=DBPASSWORD
datasource=localhost
-CATALOG=ogAdmBD
+CATALOG=DATABASE
diff --git a/admin/Sources/Services/opengnsys.default b/admin/Sources/Services/opengnsys.default
index 0c84924e..b8d4f00d 100644
--- a/admin/Sources/Services/opengnsys.default
+++ b/admin/Sources/Services/opengnsys.default
@@ -1,5 +1,5 @@
-# RUN_OGADMSERVER run OpenGNSys Admin service.
-# RUN_OGADMREPO run OpenGNSys Repository Manager service.
+# RUN_OGADMSERVER run OpenGnSys Admin service.
+# RUN_OGADMREPO run OpenGnSys Repository Manager service.
# RUN_BTTRACKER run Bittorrent Tracker
# RUN_BTSEEDER starts seeding of selected torrent files
RUN_OGADMSERVER="yes"
diff --git a/admin/WebConsole/controlacceso.php b/admin/WebConsole/controlacceso.php
index f829c3f8..29b62f35 100644
--- a/admin/WebConsole/controlacceso.php
+++ b/admin/WebConsole/controlacceso.php
@@ -11,7 +11,7 @@
//========================================================================================================
// Variables de sessión de configuración de servidor y base de datos( Modificar aquípara cambio global)
- $cnx="localhost;usuog;passusuog;ogAdmBD;mysql"; // Cadena de conexión a la base de datos
+ $cnx="localhost;DBUSER;DBPASSWORD;DATABASE;mysql"; // Cadena de conexión a la base de datos
$wer="OPENGNSYSURL/pagerror.php"; // Página de redireccionamiento de errores
$wac="OPENGNSYSURL/acceso.php"; // Página de login de la aplicación
$idi="esp"; // Idioma por defecto
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 73718940..7786a673 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -985,14 +985,14 @@ function openGnsysConfigure()
echoAndLog "${FUNCNAME}(): Creating cron files."
echo "* * * * * root [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
echoAndLog "${FUNCNAME}(): Creating OpenGnSys config file in \"$INSTALL_TARGET/etc\"."
- perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmServer.cfg
+ perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DBUSER/$OPENGNSYS_DB_USER/g; s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g; s/DATABASE/$OPENGNSYS_DATABASE/g" $INSTALL_TARGET/etc/ogAdmServer.cfg
perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmRepo.cfg
- perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmAgent.cfg
+ perl -pi -e "s/SERVERIP/$SERVERIP/g s/DBUSER/$OPENGNSYS_DB_USER/g; s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g; s/DATABASE/$OPENGNSYS_DATABASE/g" $INSTALL_TARGET/etc/ogAdmAgent.cfg
chown root:root $INSTALL_TARGET/etc/{ogAdmServer.cfg,ogAdmAgent.cfg}
chmod 600 $INSTALL_TARGET/etc/{ogAdmServer.cfg,ogAdmAgent.cfg}
echoAndLog "${FUNCNAME}(): Creating Web Console config file"
OPENGNSYS_CONSOLEURL="http://$SERVERIP/opengnsys"
- perl -pi -e "s/SERVERIP/$SERVERIP/g; s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $INSTALL_TARGET/www/controlacceso.php
+ perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DBUSER/$OPENGNSYS_DB_USER/g; s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g; s/DATABASE/$OPENGNSYS_DATABASE/g; s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $INSTALL_TARGET/www/controlacceso.php
chown $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/controlacceso.php
chmod 600 $INSTALL_TARGET/www/controlacceso.php
sed -e "s/SERVERIP/$SERVERIP/g" -e "s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient/ogAdmClient.cfg > $INSTALL_TARGET/client/etc/ogAdmClient.cfg
diff --git a/installer/opengnsys_uninstall.sh b/installer/opengnsys_uninstall.sh
index b70245dc..29879883 100755
--- a/installer/opengnsys_uninstall.sh
+++ b/installer/opengnsys_uninstall.sh
@@ -2,6 +2,14 @@
# Desinstalación de OpenGnSys.
+# Variables.
+OPENGNSYS="/opt/opengnsys" # Directorio de OpenGnSys
+OGIMG="images" # Directorio de imágenes del repositorio
+MYSQLROOT="passwordroot" # Clave de root de MySQL
+DATABASE="ogAdmBD" # Base de datos de administración
+OLDDATABASE="ogBDAdmin" # Antigua base de datos
+DBUSER="usuog" # Usuario de acceso a la base de datos
+
# Parar servicio.
echo "Uninstalling OpenGnSys services."
if [ -x /etc/init.d/opengnsys ]; then
@@ -10,7 +18,6 @@ if [ -x /etc/init.d/opengnsys ]; then
fi
# Eliminar bases de datos.
echo "Erasing OpenGnSys database."
-MYSQLROOT="passwordroot"
DROP=1
if ! mysql -u root -p"$MYSQLROOT" <<<"quit" 2>/dev/null; then
stty -echo
@@ -23,15 +30,15 @@ if ! mysql -u root -p"$MYSQLROOT" <<<"quit" 2>/dev/null; then
fi
fi
if test $DROP; then
- mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE ogBDAdmin;" 2>/dev/null
- mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE ogAdmBD;" 2>/dev/null
- mysql -u root -p"$MYSQLROOT" <<<"DROP USER 'usuog';" 2>/dev/null
- mysql -u root -p"$MYSQLROOT" <<<"DROP USER 'usuog'@'localhost';" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE $OLDDATABASE;" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE $DATABASE;" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP USER '$DBUSER';" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP USER '$DBUSER'@'localhost';" 2>/dev/null
fi
# Eliminar ficheros.
echo "Deleting OpenGnSys files."
-for dir in /opt/opengnsys/*; do
- if [ "$dir" != "/opt/opengnsys/images" ]; then
+for dir in $OPENGNSYS/*; do
+ if [ "$dir" != "$OPENGNSYS/$OGIMG" ]; then
rm -fr "$dir"
fi
done
@@ -40,5 +47,5 @@ rm -f /etc/init.d/opengnsys /etc/default/opengnsys
echo "Manual tasks:"
echo "- You may stop or uninstall manually all other services"
echo " (DHCP, PXE, TFTP, NFS, Apache, MySQL)."
-echo "- Delete repository directory \"/opt/opengnsys/images\""
+echo "- Delete repository directory \"$OGIMG\""