[a01156a] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | ##################################################################### |
---|
| 4 | ####### Script instalador OpenGnsys |
---|
| 5 | ####### autor: Luis Guillén <lguillen@unizar.es> |
---|
| 6 | ##################################################################### |
---|
| 7 | |
---|
| 8 | |
---|
[1e7eaab] | 9 | |
---|
| 10 | # Sólo ejecutable por usuario root |
---|
| 11 | if [ "$(whoami)" != 'root' ] |
---|
| 12 | then |
---|
| 13 | echo "ERROR: this program must run under root privileges!!" |
---|
| 14 | exit 1 |
---|
| 15 | fi |
---|
| 16 | |
---|
| 17 | # Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). |
---|
[49c6891] | 18 | PROGRAMDIR=$(readlink -e $(dirname "$0")) |
---|
[1e7eaab] | 19 | if [ -d "$PROGRAMDIR/../installer" ]; then |
---|
| 20 | USESVN=0 |
---|
| 21 | else |
---|
| 22 | USESVN=1 |
---|
| 23 | SVN_URL=svn://www.informatica.us.es:3690/opengnsys/trunk |
---|
| 24 | fi |
---|
| 25 | |
---|
[a01156a] | 26 | WORKDIR=/tmp/opengnsys_installer |
---|
[1e7eaab] | 27 | mkdir -p $WORKDIR |
---|
| 28 | pushd $WORKDIR |
---|
| 29 | |
---|
| 30 | INSTALL_TARGET=/opt/opengnsys |
---|
[13a01a7] | 31 | LOG_FILE=/tmp/opengnsys_installation.log |
---|
[a01156a] | 32 | |
---|
| 33 | # Array con las dependencias |
---|
[3320409] | 34 | DEPENDENCIES=( subversion apache2 php5 mysql-server php5-mysql nfs-kernel-server dhcp3-server udpcast bittorrent tftp-hpa tftpd-hpa syslinux openbsd-inetd update-inetd build-essential libmysqlclient15-dev wget doxygen graphviz bittornado ) |
---|
[a01156a] | 35 | |
---|
[892606b9] | 36 | |
---|
[a01156a] | 37 | # Datos de base de datos |
---|
[5701de1] | 38 | MYSQL_ROOT_PASSWORD="passwordroot" |
---|
| 39 | |
---|
[892606b9] | 40 | OPENGNSYS_DATABASE=ogBDAdmin |
---|
| 41 | OPENGNSYS_DB_USER=usuog |
---|
| 42 | OPENGNSYS_DB_PASSWD=passusuog |
---|
[be85bb2] | 43 | OPENGNSYS_DB_DEFAULTUSER=opengnsys |
---|
| 44 | OPENGNSYS_DB_DEFAULTPASSWD=opengnsys |
---|
[892606b9] | 45 | OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/ogBDAdmin.sql |
---|
| 46 | |
---|
[a01156a] | 47 | |
---|
| 48 | |
---|
| 49 | ##################################################################### |
---|
| 50 | ####### Algunas funciones útiles de propósito general: |
---|
| 51 | ##################################################################### |
---|
[13a01a7] | 52 | function getDateTime() |
---|
[a01156a] | 53 | { |
---|
| 54 | echo `date +%Y%m%d-%H%M%S` |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | # Escribe a fichero y muestra por pantalla |
---|
[13a01a7] | 58 | function echoAndLog() |
---|
[a01156a] | 59 | { |
---|
| 60 | echo $1 |
---|
| 61 | FECHAHORA=`getDateTime` |
---|
| 62 | echo "$FECHAHORA;$SSH_CLIENT;$1" >> $LOG_FILE |
---|
| 63 | } |
---|
| 64 | |
---|
[13a01a7] | 65 | function errorAndLog() |
---|
[a01156a] | 66 | { |
---|
| 67 | echo "ERROR: $1" |
---|
| 68 | FECHAHORA=`getDateTime` |
---|
| 69 | echo "$FECHAHORA;$SSH_CLIENT;ERROR: $1" >> $LOG_FILE |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | # comprueba si el elemento pasado en $2 esta en el array $1 |
---|
[13a01a7] | 73 | function isInArray() |
---|
[a01156a] | 74 | { |
---|
| 75 | if [ $# -ne 2 ]; then |
---|
[13a01a7] | 76 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 77 | exit 1 |
---|
| 78 | fi |
---|
| 79 | |
---|
[13a01a7] | 80 | echoAndLog "${FUNCNAME}(): checking if $2 is in $1" |
---|
[a01156a] | 81 | local deps |
---|
[5c33840] | 82 | eval "deps=( \"\${$1[@]}\" )" |
---|
[a01156a] | 83 | elemento=$2 |
---|
| 84 | |
---|
| 85 | local is_in_array=1 |
---|
| 86 | # copia local del array del parametro 1 |
---|
| 87 | for (( i = 0 ; i < ${#deps[@]} ; i++ )) |
---|
| 88 | do |
---|
| 89 | if [ "${deps[$i]}" = "${elemento}" ]; then |
---|
| 90 | echoAndLog "isInArray(): $elemento found in array" |
---|
| 91 | is_in_array=0 |
---|
| 92 | fi |
---|
| 93 | done |
---|
| 94 | |
---|
| 95 | if [ $is_in_array -ne 0 ]; then |
---|
[13a01a7] | 96 | echoAndLog "${FUNCNAME}(): $elemento NOT found in array" |
---|
[a01156a] | 97 | fi |
---|
| 98 | |
---|
| 99 | return $is_in_array |
---|
| 100 | |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | ##################################################################### |
---|
| 104 | ####### Funciones de manejo de paquetes Debian |
---|
| 105 | ##################################################################### |
---|
| 106 | |
---|
[13a01a7] | 107 | function checkPackage() |
---|
[a01156a] | 108 | { |
---|
| 109 | package=$1 |
---|
| 110 | if [ -z $package ]; then |
---|
[73cfa0a] | 111 | errorAndLog "${FUNCNAME}(): parameter required" |
---|
[a01156a] | 112 | exit 1 |
---|
| 113 | fi |
---|
[73cfa0a] | 114 | echoAndLog "${FUNCNAME}(): checking if package $package exists" |
---|
[da8db11] | 115 | dpkg -s $package &>/dev/null | grep Status | grep -qw install |
---|
[a01156a] | 116 | if [ $? -eq 0 ]; then |
---|
[73cfa0a] | 117 | echoAndLog "${FUNCNAME}(): package $package exists" |
---|
[a01156a] | 118 | return 0 |
---|
| 119 | else |
---|
[73cfa0a] | 120 | echoAndLog "${FUNCNAME}(): package $package doesn't exists" |
---|
[a01156a] | 121 | return 1 |
---|
| 122 | fi |
---|
| 123 | } |
---|
| 124 | |
---|
| 125 | # recibe array con dependencias |
---|
| 126 | # por referencia deja un array con las dependencias no resueltas |
---|
| 127 | # devuelve 1 si hay alguna dependencia no resuelta |
---|
[13a01a7] | 128 | function checkDependencies() |
---|
[a01156a] | 129 | { |
---|
| 130 | if [ $# -ne 2 ]; then |
---|
[73cfa0a] | 131 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 132 | exit 1 |
---|
| 133 | fi |
---|
| 134 | |
---|
[73cfa0a] | 135 | echoAndLog "${FUNCNAME}(): checking dependences" |
---|
[a01156a] | 136 | uncompletedeps=0 |
---|
| 137 | |
---|
| 138 | # copia local del array del parametro 1 |
---|
| 139 | local deps |
---|
[5c33840] | 140 | eval "deps=( \"\${$1[@]}\" )" |
---|
[a01156a] | 141 | |
---|
| 142 | declare -a local_notinstalled |
---|
[5c33840] | 143 | |
---|
[a01156a] | 144 | for (( i = 0 ; i < ${#deps[@]} ; i++ )) |
---|
| 145 | do |
---|
| 146 | checkPackage ${deps[$i]} |
---|
| 147 | if [ $? -ne 0 ]; then |
---|
| 148 | local_notinstalled[$uncompletedeps]=$package |
---|
| 149 | let uncompletedeps=uncompletedeps+1 |
---|
| 150 | fi |
---|
| 151 | done |
---|
| 152 | |
---|
| 153 | # relleno el array especificado en $2 por referencia |
---|
| 154 | for (( i = 0 ; i < ${#local_notinstalled[@]} ; i++ )) |
---|
| 155 | do |
---|
| 156 | eval "${2}[$i]=${local_notinstalled[$i]}" |
---|
| 157 | done |
---|
| 158 | |
---|
| 159 | # retorna el numero de paquetes no resueltos |
---|
[73cfa0a] | 160 | echoAndLog "${FUNCNAME}(): dependencies uncompleted: $uncompletedeps" |
---|
[a01156a] | 161 | return $uncompletedeps |
---|
| 162 | } |
---|
| 163 | |
---|
| 164 | # Recibe un array con las dependencias y lo instala |
---|
[13a01a7] | 165 | function installDependencies() |
---|
[a01156a] | 166 | { |
---|
| 167 | if [ $# -ne 1 ]; then |
---|
| 168 | errorAndLog "installDependencies(): invalid number of parameters" |
---|
| 169 | exit 1 |
---|
| 170 | fi |
---|
| 171 | echoAndLog "installDependencies(): installing uncompleted dependencies" |
---|
| 172 | |
---|
| 173 | # copia local del array del parametro 1 |
---|
| 174 | local deps |
---|
[5c33840] | 175 | eval "deps=( \"\${$1[@]}\" )" |
---|
[a01156a] | 176 | |
---|
| 177 | local string_deps="" |
---|
| 178 | for (( i = 0 ; i < ${#deps[@]} ; i++ )) |
---|
| 179 | do |
---|
| 180 | string_deps="$string_deps ${deps[$i]}" |
---|
| 181 | done |
---|
| 182 | |
---|
| 183 | if [ -z "${string_deps}" ]; then |
---|
| 184 | errorAndLog "installDependencies(): array of dependeces is empty" |
---|
| 185 | exit 1 |
---|
| 186 | fi |
---|
| 187 | |
---|
| 188 | OLD_DEBIAN_FRONTEND=$DEBIAN_FRONTEND |
---|
| 189 | export DEBIAN_FRONTEND=noninteractive |
---|
| 190 | |
---|
| 191 | echoAndLog "installDependencies(): now ${string_deps} will be installed" |
---|
| 192 | apt-get -y install --force-yes ${string_deps} |
---|
| 193 | if [ $? -ne 0 ]; then |
---|
| 194 | errorAndLog "installDependencies(): error installing dependencies" |
---|
| 195 | return 1 |
---|
| 196 | fi |
---|
| 197 | |
---|
| 198 | DEBIAN_FRONTEND=$OLD_DEBIAN_FRONTEND |
---|
| 199 | echoAndLog "installDependencies(): dependencies installed" |
---|
| 200 | } |
---|
| 201 | |
---|
[13a01a7] | 202 | # Hace un backup del fichero pasado por parámetro |
---|
| 203 | # deja un -last y uno para el día |
---|
| 204 | function backupFile() |
---|
| 205 | { |
---|
| 206 | if [ $# -ne 1 ]; then |
---|
| 207 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
| 208 | exit 1 |
---|
| 209 | fi |
---|
| 210 | |
---|
| 211 | local fichero=$1 |
---|
| 212 | local fecha=`date +%Y%m%d` |
---|
| 213 | |
---|
| 214 | if [ ! -f $fichero ]; then |
---|
| 215 | errorAndLog "${FUNCNAME}(): file $fichero doesn't exists" |
---|
| 216 | return 1 |
---|
| 217 | fi |
---|
| 218 | |
---|
| 219 | echoAndLog "${FUNCNAME}(): realizando backup de $fichero" |
---|
| 220 | |
---|
| 221 | # realiza una copia de la última configuración como last |
---|
| 222 | cp -p $fichero "${fichero}-LAST" |
---|
| 223 | |
---|
| 224 | # si para el día no hay backup lo hace, sino no |
---|
| 225 | if [ ! -f "${fichero}-${fecha}" ]; then |
---|
| 226 | cp -p $fichero "${fichero}-${fecha}" |
---|
| 227 | fi |
---|
| 228 | |
---|
| 229 | echoAndLog "${FUNCNAME}(): backup realizado" |
---|
| 230 | } |
---|
| 231 | |
---|
[a01156a] | 232 | ##################################################################### |
---|
| 233 | ####### Funciones para el manejo de bases de datos |
---|
| 234 | ##################################################################### |
---|
| 235 | |
---|
| 236 | # This function set password to root |
---|
[13a01a7] | 237 | function mysqlSetRootPassword() |
---|
[a01156a] | 238 | { |
---|
| 239 | if [ $# -ne 1 ]; then |
---|
| 240 | errorAndLog "mysqlSetRootPassword(): invalid number of parameters" |
---|
| 241 | exit 1 |
---|
| 242 | fi |
---|
| 243 | |
---|
| 244 | local root_mysql=$1 |
---|
| 245 | echoAndLog "mysqlSetRootPassword(): setting root password in MySQL server" |
---|
| 246 | /usr/bin/mysqladmin -u root password ${root_mysql} |
---|
| 247 | if [ $? -ne 0 ]; then |
---|
| 248 | errorAndLog "mysqlSetRootPassword(): error while setting root password in MySQL server" |
---|
| 249 | return 1 |
---|
| 250 | fi |
---|
| 251 | echoAndLog "mysqlSetRootPassword(): root password saved!" |
---|
| 252 | return 0 |
---|
| 253 | } |
---|
| 254 | |
---|
[892606b9] | 255 | # Si el servicio mysql esta ya instalado cambia la variable de la clave del root por la ya existente |
---|
[13a01a7] | 256 | function mysqlGetRootPassword(){ |
---|
[892606b9] | 257 | local pass_mysql |
---|
| 258 | local pass_mysql2 |
---|
[7c54b49] | 259 | # Comprobar si MySQL está instalado con la clave de root por defecto. |
---|
| 260 | if mysql -u root -p"$MYSQL_ROOT_PASSWORD" <<<"quit" 2>/dev/null; then |
---|
| 261 | echoAndLog "${FUNCNAME}(): Using default mysql root password." |
---|
| 262 | else |
---|
| 263 | stty -echo |
---|
| 264 | echo "Existe un servicio mysql ya instalado" |
---|
| 265 | read -p "Insertar clave de root de Mysql: " pass_mysql |
---|
| 266 | echo "" |
---|
| 267 | read -p "Confirmar clave:" pass_mysql2 |
---|
| 268 | echo "" |
---|
| 269 | stty echo |
---|
| 270 | if [ "$pass_mysql" == "$pass_mysql2" ] ;then |
---|
| 271 | MYSQL_ROOT_PASSWORD=$pass_mysql |
---|
| 272 | echo "La clave es: ${MYSQL_ROOT_PASSWORD}" |
---|
| 273 | return 0 |
---|
| 274 | else |
---|
| 275 | echo "Las claves no coinciden no se configura la clave del servidor de base de datos." |
---|
| 276 | echo "las operaciones con la base de datos daran error" |
---|
| 277 | return 1 |
---|
| 278 | fi |
---|
[892606b9] | 279 | fi |
---|
| 280 | } |
---|
| 281 | |
---|
[a01156a] | 282 | # comprueba si puede conectar con mysql con el usuario root |
---|
| 283 | function mysqlTestConnection() |
---|
| 284 | { |
---|
| 285 | if [ $# -ne 1 ]; then |
---|
| 286 | errorAndLog "mysqlTestConnection(): invalid number of parameters" |
---|
| 287 | exit 1 |
---|
| 288 | fi |
---|
| 289 | |
---|
| 290 | local root_password="${1}" |
---|
| 291 | echoAndLog "mysqlTestConnection(): checking connection to mysql..." |
---|
| 292 | echo "" | mysql -uroot -p"${root_password}" |
---|
| 293 | if [ $? -ne 0 ]; then |
---|
| 294 | errorAndLog "mysqlTestConnection(): connection to mysql failed, check root password and if daemon is running!" |
---|
| 295 | return 1 |
---|
| 296 | else |
---|
| 297 | echoAndLog "mysqlTestConnection(): connection success" |
---|
| 298 | return 0 |
---|
| 299 | fi |
---|
| 300 | } |
---|
| 301 | |
---|
| 302 | # comprueba si la base de datos existe |
---|
| 303 | function mysqlDbExists() |
---|
| 304 | { |
---|
| 305 | if [ $# -ne 2 ]; then |
---|
| 306 | errorAndLog "mysqlDbExists(): invalid number of parameters" |
---|
| 307 | exit 1 |
---|
| 308 | fi |
---|
| 309 | |
---|
| 310 | local root_password="${1}" |
---|
| 311 | local database=$2 |
---|
| 312 | echoAndLog "mysqlDbExists(): checking if $database exists..." |
---|
| 313 | echo "show databases" | mysql -uroot -p"${root_password}" | grep "^${database}$" |
---|
| 314 | if [ $? -ne 0 ]; then |
---|
| 315 | echoAndLog "mysqlDbExists():database $database doesn't exists" |
---|
| 316 | return 1 |
---|
| 317 | else |
---|
| 318 | echoAndLog "mysqlDbExists():database $database exists" |
---|
| 319 | return 0 |
---|
| 320 | fi |
---|
| 321 | } |
---|
| 322 | |
---|
| 323 | function mysqlCheckDbIsEmpty() |
---|
| 324 | { |
---|
| 325 | if [ $# -ne 2 ]; then |
---|
| 326 | errorAndLog "mysqlCheckDbIsEmpty(): invalid number of parameters" |
---|
| 327 | exit 1 |
---|
| 328 | fi |
---|
| 329 | |
---|
| 330 | local root_password="${1}" |
---|
| 331 | local database=$2 |
---|
| 332 | echoAndLog "mysqlCheckDbIsEmpty(): checking if $database is empty..." |
---|
| 333 | num_tablas=`echo "show tables" | mysql -uroot -p"${root_password}" "${database}" | wc -l` |
---|
| 334 | if [ $? -ne 0 ]; then |
---|
| 335 | errorAndLog "mysqlCheckDbIsEmpty(): error executing query, check database and root password" |
---|
| 336 | exit 1 |
---|
| 337 | fi |
---|
| 338 | |
---|
| 339 | if [ $num_tablas -eq 0 ]; then |
---|
| 340 | echoAndLog "mysqlCheckDbIsEmpty():database $database is empty" |
---|
| 341 | return 0 |
---|
| 342 | else |
---|
| 343 | echoAndLog "mysqlCheckDbIsEmpty():database $database has tables" |
---|
| 344 | return 1 |
---|
| 345 | fi |
---|
| 346 | |
---|
| 347 | } |
---|
| 348 | |
---|
| 349 | |
---|
| 350 | function mysqlImportSqlFileToDb() |
---|
| 351 | { |
---|
| 352 | if [ $# -ne 3 ]; then |
---|
[c5ce04c] | 353 | errorAndLog "${FNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 354 | exit 1 |
---|
| 355 | fi |
---|
| 356 | |
---|
| 357 | local root_password="${1}" |
---|
| 358 | local database=$2 |
---|
| 359 | local sqlfile=$3 |
---|
| 360 | |
---|
| 361 | if [ ! -f $sqlfile ]; then |
---|
[c5ce04c] | 362 | errorAndLog "${FUNCNAME}(): Unable to locate $sqlfile!!" |
---|
[a01156a] | 363 | return 1 |
---|
| 364 | fi |
---|
| 365 | |
---|
[c5ce04c] | 366 | echoAndLog "${FUNCNAME}(): importing sql file to ${database}..." |
---|
[be85bb2] | 367 | perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DEFAULTUSER/$OPENGNSYS_DB_DEFAULTUSER/g; s/DEFAULTPASSWD/$OPENGNSYS_DB_DEFAULTPASSWD/g" $sqlfile |
---|
[6cf72ba] | 368 | mysql -uroot -p"${root_password}" --default-character-set=utf8 "${database}" < $sqlfile |
---|
[a01156a] | 369 | if [ $? -ne 0 ]; then |
---|
[c5ce04c] | 370 | errorAndLog "${FUNCNAME}(): error while importing $sqlfile in database $database" |
---|
[a01156a] | 371 | return 1 |
---|
| 372 | fi |
---|
[c5ce04c] | 373 | echoAndLog "${FUNCNAME}(): file imported to database $database" |
---|
[a01156a] | 374 | return 0 |
---|
| 375 | } |
---|
| 376 | |
---|
| 377 | # Crea la base de datos |
---|
| 378 | function mysqlCreateDb() |
---|
| 379 | { |
---|
| 380 | if [ $# -ne 2 ]; then |
---|
[a555f49] | 381 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 382 | exit 1 |
---|
| 383 | fi |
---|
| 384 | |
---|
| 385 | local root_password="${1}" |
---|
| 386 | local database=$2 |
---|
| 387 | |
---|
[a555f49] | 388 | echoAndLog "${FUNCNAME}(): creating database..." |
---|
[a01156a] | 389 | mysqladmin -u root --password="${root_password}" create $database |
---|
| 390 | if [ $? -ne 0 ]; then |
---|
[a555f49] | 391 | errorAndLog "${FUNCNAME}(): error while creating database $database" |
---|
[a01156a] | 392 | return 1 |
---|
| 393 | fi |
---|
[a555f49] | 394 | echoAndLog "${FUNCNAME}(): database $database created" |
---|
[a01156a] | 395 | return 0 |
---|
| 396 | } |
---|
| 397 | |
---|
| 398 | |
---|
| 399 | function mysqlCheckUserExists() |
---|
| 400 | { |
---|
| 401 | if [ $# -ne 2 ]; then |
---|
| 402 | errorAndLog "mysqlCheckUserExists(): invalid number of parameters" |
---|
| 403 | exit 1 |
---|
| 404 | fi |
---|
| 405 | |
---|
| 406 | local root_password="${1}" |
---|
| 407 | local userdb=$2 |
---|
| 408 | |
---|
| 409 | echoAndLog "mysqlCheckUserExists(): checking if $userdb exists..." |
---|
| 410 | echo "select user from user where user='${userdb}'\\G" |mysql -uroot -p"${root_password}" mysql | grep user |
---|
| 411 | if [ $? -ne 0 ]; then |
---|
| 412 | echoAndLog "mysqlCheckUserExists(): user doesn't exists" |
---|
| 413 | return 1 |
---|
| 414 | else |
---|
| 415 | echoAndLog "mysqlCheckUserExists(): user already exists" |
---|
| 416 | return 0 |
---|
| 417 | fi |
---|
| 418 | |
---|
| 419 | } |
---|
| 420 | |
---|
| 421 | # Crea un usuario administrativo para la base de datos |
---|
| 422 | function mysqlCreateAdminUserToDb() |
---|
| 423 | { |
---|
| 424 | if [ $# -ne 4 ]; then |
---|
| 425 | errorAndLog "mysqlCreateAdminUserToDb(): invalid number of parameters" |
---|
| 426 | exit 1 |
---|
| 427 | fi |
---|
| 428 | |
---|
| 429 | local root_password=$1 |
---|
| 430 | local database=$2 |
---|
| 431 | local userdb=$3 |
---|
| 432 | local passdb=$4 |
---|
| 433 | |
---|
| 434 | echoAndLog "mysqlCreateAdminUserToDb(): creating admin user ${userdb} to database ${database}" |
---|
| 435 | |
---|
| 436 | cat > $WORKDIR/create_${database}.sql <<EOF |
---|
| 437 | GRANT USAGE ON *.* TO '${userdb}'@'localhost' IDENTIFIED BY '${passdb}' ; |
---|
| 438 | GRANT ALL PRIVILEGES ON ${database}.* TO '${userdb}'@'localhost' WITH GRANT OPTION ; |
---|
| 439 | FLUSH PRIVILEGES ; |
---|
| 440 | EOF |
---|
| 441 | mysql -u root --password=${root_password} < $WORKDIR/create_${database}.sql |
---|
| 442 | if [ $? -ne 0 ]; then |
---|
| 443 | errorAndLog "mysqlCreateAdminUserToDb(): error while creating user in mysql" |
---|
| 444 | rm -f $WORKDIR/create_${database}.sql |
---|
| 445 | return 1 |
---|
| 446 | else |
---|
| 447 | echoAndLog "mysqlCreateAdminUserToDb(): user created ok" |
---|
| 448 | rm -f $WORKDIR/create_${database}.sql |
---|
| 449 | return 0 |
---|
| 450 | fi |
---|
| 451 | } |
---|
| 452 | |
---|
| 453 | |
---|
| 454 | ##################################################################### |
---|
| 455 | ####### Funciones para el manejo de Subversion |
---|
| 456 | ##################################################################### |
---|
| 457 | |
---|
[13a01a7] | 458 | function svnExportCode() |
---|
| 459 | { |
---|
| 460 | if [ $# -ne 1 ]; then |
---|
| 461 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
| 462 | exit 1 |
---|
| 463 | fi |
---|
| 464 | |
---|
| 465 | local url=$1 |
---|
| 466 | |
---|
| 467 | echoAndLog "${FUNCNAME}(): downloading subversion code..." |
---|
| 468 | |
---|
[49c6891] | 469 | svn export "${url}" opengnsys |
---|
[13a01a7] | 470 | if [ $? -ne 0 ]; then |
---|
| 471 | errorAndLog "${FUNCNAME}(): error getting code from ${url}, verify your user and password" |
---|
| 472 | return 1 |
---|
| 473 | fi |
---|
| 474 | echoAndLog "${FUNCNAME}(): subversion code downloaded" |
---|
| 475 | return 0 |
---|
| 476 | } |
---|
| 477 | |
---|
| 478 | |
---|
[892606b9] | 479 | ############################################################ |
---|
[7586ca3] | 480 | ### Detectar red |
---|
| 481 | ############################################################ |
---|
| 482 | |
---|
| 483 | function getNetworkSettings() |
---|
| 484 | { |
---|
| 485 | # Variables globales definidas: |
---|
| 486 | # - SERVERIP: IP local del servidor. |
---|
| 487 | # - NETIP: IP de la red. |
---|
| 488 | # - NETMASK: máscara de red. |
---|
| 489 | # - NETBROAD: IP de difusión de la red. |
---|
| 490 | # - ROUTERIP: IP del router. |
---|
| 491 | # - DNSIP: IP del servidor DNS. |
---|
| 492 | |
---|
[62e3bcf] | 493 | local MAINDEV |
---|
| 494 | |
---|
| 495 | echoAndLog "${FUNCNAME}(): Detecting default network parameters." |
---|
| 496 | MAINDEV=$(ip -o link show up | awk '!/loopback/ {d=d$2} END {sub(/:.*/,"",d); print d}') |
---|
| 497 | if [ -z "$MAINDEV" ]; then |
---|
| 498 | errorAndLog "${FUNCNAME}(): Network device not detected." |
---|
| 499 | exit 1 |
---|
| 500 | fi |
---|
| 501 | SERVERIP=$(ip -o addr show dev $MAINDEV | awk '$3~/inet$/ {sub (/\/.*/, ""); print ($4)}') |
---|
| 502 | NETMASK=$(LANG=C ifconfig $MAINDEV | awk '/Mask/ {sub(/.*:/,"",$4); print $4}') |
---|
| 503 | NETBROAD=$(ip -o addr show dev $MAINDEV | awk '$3~/inet$/ {print ($6)}') |
---|
[b94a1b2] | 504 | NETIP=$(netstat -nr | grep $MAINDEV | awk '$1!~/0\.0\.0\.0/ {if (n=="") n=$1} END {print n}') |
---|
[7586ca3] | 505 | ROUTERIP=$(netstat -nr | awk '$1~/0\.0\.0\.0/ {print $2}') |
---|
[a555f49] | 506 | DNSIP=$(awk '/nameserver/ {print $2}' /etc/resolv.conf | head -n1) |
---|
[7586ca3] | 507 | if [ -z "$NETIP" -o -z "$NETMASK" ]; then |
---|
[62e3bcf] | 508 | errorAndLog "${FUNCNAME}(): Network not detected." |
---|
[7586ca3] | 509 | exit 1 |
---|
| 510 | fi |
---|
[cc7eab7] | 511 | |
---|
| 512 | # Variables de ejecución de Apache |
---|
| 513 | # - APACHE_RUN_USER |
---|
| 514 | # - APACHE_RUN_GROUP |
---|
| 515 | if [ -f /etc/apache2/envvars ]; then |
---|
| 516 | source /etc/apache2/envvars |
---|
| 517 | fi |
---|
| 518 | APACHE_RUN_USER=${APACHE_RUN_USER:-"www-data"} |
---|
| 519 | APACHE_RUN_GROUP=${APACHE_RUN_GROUP:-"www-data"} |
---|
[7586ca3] | 520 | } |
---|
| 521 | |
---|
| 522 | |
---|
| 523 | ############################################################ |
---|
[892606b9] | 524 | ### Esqueleto para el Servicio pxe y contenedor tftpboot ### |
---|
| 525 | ############################################################ |
---|
| 526 | |
---|
| 527 | function tftpConfigure() { |
---|
| 528 | echo "Configurando el servicio tftp" |
---|
| 529 | basetftp=/var/lib/tftpboot |
---|
| 530 | |
---|
| 531 | # reiniciamos demonio internet ????? porque ???? |
---|
| 532 | /etc/init.d/openbsd-inetd start |
---|
| 533 | |
---|
| 534 | # preparacion contenedor tftpboot |
---|
| 535 | cp -pr /usr/lib/syslinux/ ${basetftp}/syslinux |
---|
| 536 | cp /usr/lib/syslinux/pxelinux.0 ${basetftp} |
---|
| 537 | # prepamos el directorio de la configuracion de pxe |
---|
| 538 | mkdir -p ${basetftp}/pxelinux.cfg |
---|
| 539 | cat > ${basetftp}/pxelinux.cfg/default <<EOF |
---|
| 540 | DEFAULT pxe |
---|
| 541 | |
---|
| 542 | LABEL pxe |
---|
| 543 | KERNEL linux |
---|
| 544 | APPEND initrd=initrd.gz ip=dhcp ro vga=788 irqpoll acpi=on |
---|
| 545 | EOF |
---|
| 546 | # comprobamos el servicio tftp |
---|
| 547 | sleep 1 |
---|
| 548 | testPxe |
---|
| 549 | ## damos perfimos de lectura a usuario web. |
---|
[cc7eab7] | 550 | chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP ${basetftp} |
---|
[892606b9] | 551 | } |
---|
| 552 | |
---|
| 553 | function testPxe () { |
---|
| 554 | cd /tmp |
---|
| 555 | echo "comprobando servicio pxe ..... Espere" |
---|
| 556 | tftp -v localhost -c get pxelinux.0 /tmp/pxelinux.0 && echo "servidor tftp OK" || echo "servidor tftp KO" |
---|
| 557 | cd / |
---|
| 558 | } |
---|
| 559 | |
---|
| 560 | ######################################################################## |
---|
[b6906f7] | 561 | ## Configuracion servicio NFS |
---|
[892606b9] | 562 | ######################################################################## |
---|
| 563 | |
---|
[13a01a7] | 564 | # ADVERTENCIA: usa variables globales NETIP y NETMASK! |
---|
| 565 | function nfsConfigure() |
---|
[7586ca3] | 566 | { |
---|
[13a01a7] | 567 | echoAndLog "${FUNCNAME}(): Config nfs server." |
---|
| 568 | |
---|
| 569 | backupFile /etc/exports |
---|
| 570 | |
---|
| 571 | nfsAddExport /opt/opengnsys/client ${NETIP}/${NETMASK}:ro,no_subtree_check,no_root_squash,sync |
---|
| 572 | if [ $? -ne 0 ]; then |
---|
| 573 | errorAndLog "${FUNCNAME}(): error while adding nfs client config" |
---|
| 574 | return 1 |
---|
| 575 | fi |
---|
| 576 | |
---|
| 577 | nfsAddExport /opt/opengnsys/images ${NETIP}/${NETMASK}:rw,no_subtree_check,no_root_squash,sync,crossmnt |
---|
| 578 | if [ $? -ne 0 ]; then |
---|
| 579 | errorAndLog "${FUNCNAME}(): error while adding nfs images config" |
---|
| 580 | return 1 |
---|
| 581 | fi |
---|
| 582 | |
---|
| 583 | nfsAddExport /opt/opengnsys/log/clients ${NETIP}/${NETMASK}:rw,no_subtree_check,no_root_squash,sync |
---|
| 584 | if [ $? -ne 0 ]; then |
---|
| 585 | errorAndLog "${FUNCNAME}(): error while adding logging client config" |
---|
| 586 | return 1 |
---|
| 587 | fi |
---|
| 588 | |
---|
[7586ca3] | 589 | /etc/init.d/nfs-kernel-server restart |
---|
[13a01a7] | 590 | |
---|
[b6906f7] | 591 | exportfs -va |
---|
[13a01a7] | 592 | if [ $? -ne 0 ]; then |
---|
| 593 | errorAndLog "${FUNCNAME}(): error while configure exports" |
---|
| 594 | return 1 |
---|
| 595 | fi |
---|
| 596 | |
---|
| 597 | echoAndLog "${FUNCNAME}(): Added NFS configuration to file \"/etc/exports\"." |
---|
| 598 | return 0 |
---|
[b6906f7] | 599 | } |
---|
[892606b9] | 600 | |
---|
[b6906f7] | 601 | |
---|
[13a01a7] | 602 | # ejemplos: |
---|
| 603 | #nfsAddExport /opt/opengnsys 192.168.0.0/255.255.255.0:ro,no_subtree_check,no_root_squash,sync |
---|
| 604 | #nfsAddExport /opt/opengnsys 192.168.0.0/255.255.255.0 |
---|
| 605 | #nfsAddExport /opt/opengnsys 80.20.2.1:ro 192.123.32.2:rw |
---|
| 606 | function nfsAddExport() |
---|
| 607 | { |
---|
| 608 | if [ $# -lt 2 ]; then |
---|
| 609 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
| 610 | exit 1 |
---|
| 611 | fi |
---|
| 612 | |
---|
| 613 | if [ ! -f /etc/exports ]; then |
---|
| 614 | errorAndLog "${FUNCNAME}(): /etc/exports don't exists" |
---|
| 615 | return 1 |
---|
| 616 | fi |
---|
| 617 | |
---|
| 618 | local export="${1}" |
---|
| 619 | local contador=0 |
---|
| 620 | local cadenaexport |
---|
| 621 | |
---|
| 622 | grep "^${export}" /etc/exports > /dev/null |
---|
| 623 | if [ $? -eq 0 ]; then |
---|
| 624 | echoAndLog "${FUNCNAME}(): $export exists in /etc/exports, omiting" |
---|
| 625 | return 0 |
---|
| 626 | fi |
---|
| 627 | |
---|
| 628 | cadenaexport="${export}" |
---|
| 629 | for parametro in $* |
---|
| 630 | do |
---|
| 631 | if [ $contador -gt 0 ] |
---|
| 632 | then |
---|
| 633 | host=`echo $parametro | awk -F: '{print $1}'` |
---|
| 634 | options=`echo $parametro | awk -F: '{print $2}'` |
---|
| 635 | if [ "${host}" == "" ]; then |
---|
| 636 | errorAndLog "${FUNCNAME}(): host can't be empty" |
---|
| 637 | return 1 |
---|
| 638 | fi |
---|
| 639 | cadenaexport="${cadenaexport}\t${host}" |
---|
| 640 | |
---|
| 641 | if [ "${options}" != "" ]; then |
---|
| 642 | cadenaexport="${cadenaexport}(${options})" |
---|
| 643 | fi |
---|
| 644 | fi |
---|
| 645 | let contador=contador+1 |
---|
| 646 | done |
---|
| 647 | |
---|
| 648 | echo -en "$cadenaexport\n" >> /etc/exports |
---|
| 649 | |
---|
| 650 | echoAndLog "${FUNCNAME}(): add $export to /etc/exports" |
---|
| 651 | |
---|
| 652 | return 0 |
---|
| 653 | } |
---|
| 654 | |
---|
[b6906f7] | 655 | ######################################################################## |
---|
| 656 | ## Configuracion servicio DHCP |
---|
| 657 | ######################################################################## |
---|
| 658 | |
---|
[7586ca3] | 659 | function dhcpConfigure() |
---|
| 660 | { |
---|
[a555f49] | 661 | echoAndLog "${FUNCNAME}(): Sample DHCP Configuration." |
---|
| 662 | |
---|
| 663 | backupFile /etc/dhcp3/dhcpd.conf |
---|
| 664 | |
---|
[7586ca3] | 665 | sed -e "s/SERVERIP/$SERVERIP/g" \ |
---|
| 666 | -e "s/NETIP/$NETIP/g" \ |
---|
| 667 | -e "s/NETMASK/$NETMASK/g" \ |
---|
| 668 | -e "s/NETBROAD/$NETBROAD/g" \ |
---|
| 669 | -e "s/ROUTERIP/$ROUTERIP/g" \ |
---|
| 670 | -e "s/DNSIP/$DNSIP/g" \ |
---|
| 671 | $WORKDIR/opengnsys/server/DHCP/dhcpd.conf > /etc/dhcp3/dhcpd.conf |
---|
[a555f49] | 672 | if [ $? -ne 0 ]; then |
---|
| 673 | errorAndLog "${FUNCNAME}(): error while configuring dhcp server" |
---|
| 674 | return 1 |
---|
| 675 | fi |
---|
| 676 | |
---|
[7586ca3] | 677 | /etc/init.d/dhcp3-server restart |
---|
[a555f49] | 678 | echoAndLog "${FUNCNAME}(): Sample DHCP Configured in file \"/etc/dhcp3/dhcpd.conf\"." |
---|
| 679 | return 0 |
---|
[892606b9] | 680 | } |
---|
| 681 | |
---|
| 682 | |
---|
[a01156a] | 683 | ##################################################################### |
---|
| 684 | ####### Funciones específicas de la instalación de Opengnsys |
---|
| 685 | ##################################################################### |
---|
| 686 | |
---|
[49c6891] | 687 | # Copiar ficheros del OpenGnSys Web Console. |
---|
[7586ca3] | 688 | function installWebFiles() |
---|
| 689 | { |
---|
[dce072b] | 690 | echoAndLog "${FUNCNAME}(): Installing web files..." |
---|
[7586ca3] | 691 | cp -ar $WORKDIR/opengnsys/admin/WebConsole/* $INSTALL_TARGET/www #*/ comentario para doxigen |
---|
| 692 | if [ $? != 0 ]; then |
---|
[dce072b] | 693 | errorAndLog "${FUNCNAME}(): Error copying web files." |
---|
[7586ca3] | 694 | exit 1 |
---|
| 695 | fi |
---|
| 696 | find $INSTALL_TARGET/www -name .svn -type d -exec rm -fr {} \; 2>/dev/null |
---|
| 697 | # Cambiar permisos para ficheros especiales. |
---|
[cc7eab7] | 698 | chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP \ |
---|
| 699 | $INSTALL_TARGET/www/includes \ |
---|
| 700 | $INSTALL_TARGET/www/comandos/gestores/filescripts \ |
---|
[dce072b] | 701 | $INSTALL_TARGET/www/images/iconos |
---|
| 702 | echoAndLog "${FUNCNAME}(): Web files installed successfully." |
---|
[7586ca3] | 703 | } |
---|
| 704 | |
---|
| 705 | # Configuración específica de Apache. |
---|
[892606b9] | 706 | function openGnsysInstallWebConsoleApacheConf() |
---|
[a01156a] | 707 | { |
---|
| 708 | if [ $# -ne 2 ]; then |
---|
[dce072b] | 709 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 710 | exit 1 |
---|
| 711 | fi |
---|
| 712 | |
---|
| 713 | local path_opengnsys_base=$1 |
---|
| 714 | local path_apache2_confd=$2 |
---|
[892606b9] | 715 | local path_web_console=${path_opengnsys_base}/www |
---|
[a01156a] | 716 | |
---|
[892606b9] | 717 | if [ ! -d $path_apache2_confd ]; then |
---|
[dce072b] | 718 | errorAndLog "${FUNCNAME}(): path to apache2 conf.d can not found, verify your server installation" |
---|
[892606b9] | 719 | return 1 |
---|
| 720 | fi |
---|
| 721 | |
---|
[7586ca3] | 722 | mkdir -p $path_apache2_confd/{sites-available,sites-enabled} |
---|
[892606b9] | 723 | |
---|
[dce072b] | 724 | echoAndLog "${FUNCNAME}(): creating apache2 config file.." |
---|
[a01156a] | 725 | |
---|
[d725a41] | 726 | |
---|
[a01156a] | 727 | # genera configuración |
---|
[892606b9] | 728 | cat > $path_opengnsys_base/etc/apache.conf <<EOF |
---|
[49c6891] | 729 | # OpenGnSys Web Console configuration for Apache |
---|
[a01156a] | 730 | |
---|
[892606b9] | 731 | Alias /opengnsys ${path_web_console} |
---|
[a01156a] | 732 | |
---|
[892606b9] | 733 | <Directory ${path_web_console}> |
---|
[a01156a] | 734 | Options -Indexes FollowSymLinks |
---|
| 735 | DirectoryIndex acceso.php |
---|
| 736 | </Directory> |
---|
| 737 | EOF |
---|
| 738 | |
---|
[7586ca3] | 739 | ln -fs $path_opengnsys_base/etc/apache.conf $path_apache2_confd/sites-available/opengnsys.conf |
---|
| 740 | ln -fs $path_apache2_confd/sites-available/opengnsys.conf $path_apache2_confd/sites-enabled/opengnsys.conf |
---|
[a01156a] | 741 | if [ $? -ne 0 ]; then |
---|
[dce072b] | 742 | errorAndLog "${FUNCNAME}(): config file can't be linked to apache conf, verify your server installation" |
---|
[a01156a] | 743 | return 1 |
---|
| 744 | else |
---|
[dce072b] | 745 | echoAndLog "${FUNCNAME}(): config file created and linked, restarting apache daemon" |
---|
[077dd7c5] | 746 | /etc/init.d/apache2 restart |
---|
[a01156a] | 747 | return 0 |
---|
| 748 | fi |
---|
| 749 | } |
---|
| 750 | |
---|
[5d6bf97] | 751 | # Crear documentación Doxygen para la consola web. |
---|
| 752 | function makeDoxygenFiles() |
---|
| 753 | { |
---|
| 754 | echoAndLog "${FUNCNAME}(): Making Doxygen web files..." |
---|
| 755 | $WORKDIR/opengnsys/installer/ogGenerateDoc.sh \ |
---|
| 756 | $WORKDIR/opengnsys/client/engine $INSTALL_TARGET/www |
---|
| 757 | if [ ! -d "$INSTALL_TARGET/www/html" ]; then |
---|
| 758 | errorAndLog "${FUNCNAME}(): unable to create Doxygen web files." |
---|
[ead38fb] | 759 | return 1 |
---|
[5d6bf97] | 760 | fi |
---|
| 761 | mv "$INSTALL_TARGET/www/html" "$INSTALL_TARGET/www/api" |
---|
| 762 | chown -R $APACHE_RUN_USER:$APACHE_RUN_GROUP $INSTALL_TARGET/www/api |
---|
| 763 | echoAndLog "${FUNCNAME}(): Doxygen web files created successfully." |
---|
| 764 | } |
---|
| 765 | |
---|
| 766 | |
---|
[a01156a] | 767 | # Crea la estructura base de la instalación de opengnsys |
---|
[318efac] | 768 | function openGnsysInstallCreateDirs() |
---|
[a01156a] | 769 | { |
---|
| 770 | if [ $# -ne 1 ]; then |
---|
[dce072b] | 771 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[a01156a] | 772 | exit 1 |
---|
| 773 | fi |
---|
| 774 | |
---|
| 775 | local path_opengnsys_base=$1 |
---|
| 776 | |
---|
[dce072b] | 777 | echoAndLog "${FUNCNAME}(): creating directory paths in $path_opengnsys_base" |
---|
[a01156a] | 778 | |
---|
| 779 | mkdir -p $path_opengnsys_base |
---|
[077dd7c5] | 780 | mkdir -p $path_opengnsys_base/admin/{autoexec,comandos,menus,usuarios} |
---|
[a01156a] | 781 | mkdir -p $path_opengnsys_base/bin |
---|
[5c33840] | 782 | mkdir -p $path_opengnsys_base/client |
---|
[49c6891] | 783 | mkdir -p $path_opengnsys_base/doc |
---|
[5c33840] | 784 | mkdir -p $path_opengnsys_base/etc |
---|
[a01156a] | 785 | mkdir -p $path_opengnsys_base/lib |
---|
[1cc5697] | 786 | mkdir -p $path_opengnsys_base/log/clients |
---|
[7586ca3] | 787 | mkdir -p $path_opengnsys_base/sbin |
---|
[a01156a] | 788 | mkdir -p $path_opengnsys_base/www |
---|
[5c33840] | 789 | mkdir -p $path_opengnsys_base/images |
---|
[b6906f7] | 790 | ln -fs /var/lib/tftpboot $path_opengnsys_base |
---|
| 791 | ln -fs $path_opengnsys_base/log /var/log/opengnsys |
---|
[5c33840] | 792 | |
---|
[a01156a] | 793 | if [ $? -ne 0 ]; then |
---|
[dce072b] | 794 | errorAndLog "${FUNCNAME}(): error while creating dirs. Do you have write permissions?" |
---|
[a01156a] | 795 | return 1 |
---|
| 796 | fi |
---|
| 797 | |
---|
[dce072b] | 798 | echoAndLog "${FUNCNAME}(): directory paths created" |
---|
[a01156a] | 799 | return 0 |
---|
| 800 | } |
---|
| 801 | |
---|
[463a1d49] | 802 | # Copia ficheros de configuración y ejecutables genéricos del servidor. |
---|
[318efac] | 803 | function openGnsysCopyServerFiles () { |
---|
[463a1d49] | 804 | if [ $# -ne 1 ]; then |
---|
[879689f] | 805 | errorAndLog "${FUNCNAME}(): invalid number of parameters" |
---|
[463a1d49] | 806 | exit 1 |
---|
| 807 | fi |
---|
| 808 | |
---|
| 809 | local path_opengnsys_base=$1 |
---|
| 810 | |
---|
[892606b9] | 811 | local SOURCES=( client/boot/initrd-generator \ |
---|
[b6906f7] | 812 | client/boot/upgrade-clients-udeb.sh \ |
---|
[a555f49] | 813 | client/boot/udeblist.conf \ |
---|
| 814 | client/boot/udeblist-jaunty.conf \ |
---|
[879689f] | 815 | client/boot/udeblist-karmic.conf \ |
---|
[8826968] | 816 | client/boot/udeblist-lucid.conf \ |
---|
[49c6891] | 817 | server/PXE/pxelinux.cfg/default \ |
---|
[85b029f] | 818 | repoman/bin \ |
---|
[49c6891] | 819 | doc ) |
---|
[892606b9] | 820 | local TARGETS=( bin/initrd-generator \ |
---|
[b6906f7] | 821 | bin/upgrade-clients-udeb.sh \ |
---|
[a555f49] | 822 | etc/udeblist.conf \ |
---|
| 823 | etc/udeblist-jaunty.conf \ |
---|
[879689f] | 824 | etc/udeblist-karmic.conf \ |
---|
[8826968] | 825 | etc/udeblist-lucid.conf \ |
---|
[49c6891] | 826 | tftpboot/pxelinux.cfg/default \ |
---|
[85b029f] | 827 | bin \ |
---|
[49c6891] | 828 | doc ) |
---|
[463a1d49] | 829 | |
---|
| 830 | if [ ${#SOURCES[@]} != ${#TARGETS[@]} ]; then |
---|
[879689f] | 831 | errorAndLog "${FUNCNAME}(): inconsistent number of array items" |
---|
[463a1d49] | 832 | exit 1 |
---|
| 833 | fi |
---|
| 834 | |
---|
[879689f] | 835 | echoAndLog "${FUNCNAME}(): copying files to server directories" |
---|
[f2bb433] | 836 | |
---|
[8457092] | 837 | pushd $WORKDIR/opengnsys |
---|
[463a1d49] | 838 | local i |
---|
| 839 | for (( i = 0; i < ${#SOURCES[@]}; i++ )); do |
---|
| 840 | if [ -f "${SOURCES[$i]}" ]; then |
---|
[879689f] | 841 | echoAndLog "Copying ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}" |
---|
[463a1d49] | 842 | cp -p "${SOURCES[$i]}" "${path_opengnsys_base}/${TARGETS[$i]}" |
---|
[8457092] | 843 | elif [ -d "${SOURCES[$i]}" ]; then |
---|
[879689f] | 844 | echoAndLog "Copying content of ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}" |
---|
[8457092] | 845 | cp -a "${SOURCES[$i]}"/* "${path_opengnsys_base}/${TARGETS[$i]}" |
---|
| 846 | else |
---|
| 847 | echoAndLog "Warning: Unable to copy ${SOURCES[$i]} to $path_opengnsys_base/${TARGETS[$i]}" |
---|
[463a1d49] | 848 | fi |
---|
| 849 | done |
---|
[7586ca3] | 850 | popd |
---|
[892606b9] | 851 | } |
---|
| 852 | |
---|
[7586ca3] | 853 | #################################################################### |
---|
| 854 | ### Funciones de compilación de códifo fuente de servicios |
---|
| 855 | #################################################################### |
---|
| 856 | |
---|
[b6906f7] | 857 | # Compilar los servicios de OpenGNsys |
---|
[7586ca3] | 858 | function servicesCompilation () |
---|
| 859 | { |
---|
[13a01a7] | 860 | local hayErrores=0 |
---|
[0795938] | 861 | |
---|
[49c6891] | 862 | # Compilar OpenGnSys Server |
---|
| 863 | echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Admin Server" |
---|
[318efac] | 864 | pushd $WORKDIR/opengnsys/admin/Services/ogAdmServer |
---|
[b6906f7] | 865 | make && make install |
---|
[13a01a7] | 866 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 867 | echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Admin Server" |
---|
[13a01a7] | 868 | hayErrores=1 |
---|
| 869 | fi |
---|
[7586ca3] | 870 | popd |
---|
[49c6891] | 871 | # Compilar OpenGnSys Repository Manager |
---|
| 872 | echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Repository Manager" |
---|
[318efac] | 873 | pushd $WORKDIR/opengnsys/admin/Services/ogAdmRepo |
---|
[b6906f7] | 874 | make && make install |
---|
[13a01a7] | 875 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 876 | echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Repository Manager" |
---|
[13a01a7] | 877 | hayErrores=1 |
---|
| 878 | fi |
---|
[8125e7c] | 879 | popd |
---|
[4984660] | 880 | # Compilar OpenGnSys Agent |
---|
| 881 | echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Agent" |
---|
| 882 | pushd $WORKDIR/opengnsys/admin/Services/ogAdmAgent |
---|
| 883 | make && make install |
---|
| 884 | if [ $? -ne 0 ]; then |
---|
| 885 | echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Agent" |
---|
| 886 | hayErrores=1 |
---|
| 887 | fi |
---|
| 888 | popd |
---|
[49c6891] | 889 | # Compilar OpenGnSys Client |
---|
| 890 | echoAndLog "${FUNCNAME}(): Compiling OpenGnSys Admin Client" |
---|
[318efac] | 891 | pushd $WORKDIR/opengnsys/admin/Services/ogAdmClient |
---|
| 892 | make && mv ogAdmClient ../../../client/nfsexport/bin |
---|
[13a01a7] | 893 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 894 | echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Admin Client" |
---|
[13a01a7] | 895 | hayErrores=1 |
---|
| 896 | fi |
---|
[318efac] | 897 | popd |
---|
[13a01a7] | 898 | |
---|
| 899 | return $hayErrores |
---|
[b6906f7] | 900 | } |
---|
| 901 | |
---|
| 902 | |
---|
[892606b9] | 903 | #################################################################### |
---|
| 904 | ### Funciones instalacion cliente opengnsys |
---|
| 905 | #################################################################### |
---|
| 906 | |
---|
[a555f49] | 907 | function openGnsysClientCreate() |
---|
[7586ca3] | 908 | { |
---|
| 909 | local OSDISTRIB OSCODENAME |
---|
[892606b9] | 910 | |
---|
[a555f49] | 911 | local hayErrores=0 |
---|
| 912 | |
---|
[49c6891] | 913 | echoAndLog "${FUNCNAME}(): Copying OpenGnSys Client files." |
---|
[892606b9] | 914 | cp -ar $WORKDIR/opengnsys/client/nfsexport/* $INSTALL_TARGET/client |
---|
[b6906f7] | 915 | find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null |
---|
[49c6891] | 916 | echoAndLog "${FUNCNAME}(): Copying OpenGnSys Cloning Engine files." |
---|
[b6906f7] | 917 | mkdir -p $INSTALL_TARGET/client/lib/engine/bin |
---|
[892606b9] | 918 | cp -ar $WORKDIR/opengnsys/client/engine/*.lib $INSTALL_TARGET/client/lib/engine/bin |
---|
[a555f49] | 919 | if [ $? -ne 0 ]; then |
---|
| 920 | errorAndLog "${FUNCNAME}(): error while copying engine files" |
---|
| 921 | hayErrores=1 |
---|
| 922 | fi |
---|
[892606b9] | 923 | |
---|
[cc7eab7] | 924 | # Cargar Kernel, Initrd y paquetes udeb para la distribución del servidor (o por defecto). |
---|
[d345fa6] | 925 | OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null |
---|
| 926 | OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null |
---|
[7586ca3] | 927 | if [ "$OSDISTRIB" = "Ubuntu" -a -n "$OSCODENAME" ]; then |
---|
[a555f49] | 928 | echoAndLog "${FUNCNAME}(): Loading Kernel and Initrd files for $OSDISTRIB $OSCODENAME." |
---|
[da8db11] | 929 | $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot -v $OSCODENAME 2>&1 | tee -a $LOG_FILE |
---|
[a555f49] | 930 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 931 | errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client" |
---|
[a555f49] | 932 | hayErrores=1 |
---|
| 933 | fi |
---|
| 934 | echoAndLog "${FUNCNAME}(): Loading udeb files for $OSDISTRIB $OSCODENAME." |
---|
[da8db11] | 935 | $INSTALL_TARGET/bin/upgrade-clients-udeb.sh $OSCODENAME 2>&1 | tee -a $LOG_FILE |
---|
[a555f49] | 936 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 937 | errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client" |
---|
[a555f49] | 938 | hayErrores=1 |
---|
| 939 | fi |
---|
[7586ca3] | 940 | else |
---|
[a555f49] | 941 | echoAndLog "${FUNCNAME}(): Loading default Kernel and Initrd files." |
---|
[da8db11] | 942 | $INSTALL_TARGET/bin/initrd-generator -t $INSTALL_TARGET/tftpboot 2>&1 | tee -a $LOG_FILE |
---|
[a555f49] | 943 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 944 | errorAndLog "${FUNCNAME}(): error while generating initrd OpenGnSys Admin Client" |
---|
[a555f49] | 945 | hayErrores=1 |
---|
| 946 | fi |
---|
| 947 | echoAndLog "${FUNCNAME}(): Loading default udeb files." |
---|
[da8db11] | 948 | $INSTALL_TARGET/bin/upgrade-clients-udeb.sh 2>&1 | tee -a $LOG_FILE |
---|
[a555f49] | 949 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 950 | errorAndLog "${FUNCNAME}(): error while upgrading udeb files OpenGnSys Admin Client" |
---|
[a555f49] | 951 | hayErrores=1 |
---|
| 952 | fi |
---|
| 953 | fi |
---|
| 954 | |
---|
| 955 | if [ $hayErrores -eq 0 ]; then |
---|
| 956 | echoAndLog "${FUNCNAME}(): Client generation success." |
---|
| 957 | else |
---|
| 958 | errorAndLog "${FUNCNAME}(): Client generation with errors" |
---|
[7586ca3] | 959 | fi |
---|
[a555f49] | 960 | |
---|
| 961 | return $hayErrores |
---|
[463a1d49] | 962 | } |
---|
| 963 | |
---|
| 964 | |
---|
[49c6891] | 965 | # Configuración básica de servicios de OpenGnSys |
---|
[cc7eab7] | 966 | function openGnsysConfigure() |
---|
| 967 | { |
---|
| 968 | echoAndLog "openGnsysConfigure(): Copying init files." |
---|
| 969 | cp -p $WORKDIR/opengnsys/admin/Services/opengnsys.init /etc/init.d/opengnsys |
---|
| 970 | cp -p $WORKDIR/opengnsys/admin/Services/opengnsys.default /etc/default/opengnsys |
---|
| 971 | update-rc.d opengnsys defaults |
---|
[49c6891] | 972 | echoAndLog "openGnsysConfigure(): Creating OpenGnSys config file in \"$INSTALL_TARGET/etc\"." |
---|
[1a22cd2] | 973 | perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmServer.cfg |
---|
| 974 | perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmRepo.cfg |
---|
[4984660] | 975 | perl -pi -e "s/SERVERIP/$SERVERIP/g" $INSTALL_TARGET/etc/ogAdmAgent.cfg |
---|
[ea7186c] | 976 | echoAndLog "${FUNCNAME}(): Creating Web Console config file" |
---|
| 977 | OPENGNSYS_CONSOLEURL="http://$SERVERIP/opengnsys" |
---|
| 978 | perl -pi -e "s/SERVERIP/$SERVERIP/g; s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $INSTALL_TARGET/www/controlacceso.php |
---|
| 979 | sed -e "s/SERVERIP/$SERVERIP/g" -e "s/OPENGNSYSURL/${OPENGNSYS_CONSOLEURL//\//\\/}/g" $WORKDIR/opengnsys/admin/Services/ogAdmClient/ogAdmClient.cfg > $INSTALL_TARGET/client/etc/ogAdmClient.cfg |
---|
[49c6891] | 980 | echoAndLog "openGnsysConfiguration(): Starting OpenGnSys services." |
---|
[cc7eab7] | 981 | /etc/init.d/opengnsys start |
---|
| 982 | } |
---|
| 983 | |
---|
[b6906f7] | 984 | |
---|
[a01156a] | 985 | ##################################################################### |
---|
[180a07dd] | 986 | ####### Función de resumen informativo de la instalación |
---|
| 987 | ##################################################################### |
---|
| 988 | |
---|
| 989 | function installationSummary(){ |
---|
| 990 | echo |
---|
[49c6891] | 991 | echoAndLog "OpenGnSys Installation Summary" |
---|
[180a07dd] | 992 | echo "==============================" |
---|
[8457092] | 993 | echoAndLog "Project version: $(cat $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null)" |
---|
[49c6891] | 994 | echoAndLog "Installation directory: $INSTALL_TARGET" |
---|
| 995 | echoAndLog "Repository directory: $INSTALL_TARGET/images" |
---|
[180a07dd] | 996 | echoAndLog "TFTP configuracion directory: /var/lib/tftpboot" |
---|
| 997 | echoAndLog "DHCP configuracion file: /etc/dhcp3/dhcpd.conf" |
---|
| 998 | echoAndLog "NFS configuracion file: /etc/exports" |
---|
[49c6891] | 999 | echoAndLog "Web Console URL: $OPENGNSYS_CONSOLEURL" |
---|
[180a07dd] | 1000 | echoAndLog "Web Console admin user: $OPENGNSYS_DB_USER" |
---|
| 1001 | echoAndLog "Web Console admin password: $OPENGNSYS_DB_PASSWD" |
---|
[c5ce04c] | 1002 | echoAndLog "Web Console default user: $OPENGNSYS_DB_DEFAULTUSER" |
---|
| 1003 | echoAndLog "Web Console default password: $OPENGNSYS_DB_DEFAULTPASSWD" |
---|
[180a07dd] | 1004 | echo |
---|
| 1005 | echoAndLog "Post-Installation Instructions:" |
---|
| 1006 | echo "===============================" |
---|
| 1007 | echoAndLog "Review or edit all configuration files." |
---|
[c5ce04c] | 1008 | echoAndLog "Insert DHCP configuration data and restart service." |
---|
[180a07dd] | 1009 | echoAndLog "Log-in as Web Console admin user." |
---|
[c5ce04c] | 1010 | echoAndLog " - Review default Organization data and default user." |
---|
[180a07dd] | 1011 | echoAndLog "Log-in as Web Console organization user." |
---|
[49c6891] | 1012 | echoAndLog " - Insert OpenGnSys data (rooms, computers, etc)." |
---|
[180a07dd] | 1013 | echo |
---|
| 1014 | } |
---|
| 1015 | |
---|
| 1016 | |
---|
| 1017 | |
---|
| 1018 | ##################################################################### |
---|
[49c6891] | 1019 | ####### Proceso de instalación de OpenGnSys |
---|
[a01156a] | 1020 | ##################################################################### |
---|
| 1021 | |
---|
[7586ca3] | 1022 | |
---|
[49c6891] | 1023 | echoAndLog "OpenGnSys installation begins at $(date)" |
---|
[cc7eab7] | 1024 | |
---|
[7c54b49] | 1025 | # Detener servicios de OpenGnSys, si están activos previamente. |
---|
| 1026 | [ -f /etc/init.d/opengnsys ] && /etc/init.d/opengnsys stop |
---|
| 1027 | |
---|
[7586ca3] | 1028 | # Detectar parámetros de red por defecto |
---|
| 1029 | getNetworkSettings |
---|
| 1030 | if [ $? -ne 0 ]; then |
---|
| 1031 | errorAndLog "Error reading default network settings." |
---|
| 1032 | exit 1 |
---|
| 1033 | fi |
---|
| 1034 | |
---|
[318efac] | 1035 | # Actualizar repositorios |
---|
| 1036 | apt-get update |
---|
| 1037 | |
---|
[b6906f7] | 1038 | # Instalación de dependencias (paquetes de sistema operativo). |
---|
[a01156a] | 1039 | declare -a notinstalled |
---|
| 1040 | checkDependencies DEPENDENCIES notinstalled |
---|
| 1041 | if [ $? -ne 0 ]; then |
---|
| 1042 | installDependencies notinstalled |
---|
| 1043 | if [ $? -ne 0 ]; then |
---|
| 1044 | echoAndLog "Error while installing some dependeces, please verify your server installation before continue" |
---|
| 1045 | exit 1 |
---|
| 1046 | fi |
---|
| 1047 | fi |
---|
| 1048 | |
---|
[49c6891] | 1049 | # Arbol de directorios de OpenGnSys. |
---|
[a01156a] | 1050 | openGnsysInstallCreateDirs ${INSTALL_TARGET} |
---|
| 1051 | if [ $? -ne 0 ]; then |
---|
| 1052 | errorAndLog "Error while creating directory paths!" |
---|
| 1053 | exit 1 |
---|
| 1054 | fi |
---|
[b6906f7] | 1055 | |
---|
[1e7eaab] | 1056 | # Si es necesario, descarga el repositorio de código en directorio temporal |
---|
[49c6891] | 1057 | if [ $USESVN -eq 1 ]; then |
---|
[1e7eaab] | 1058 | svnExportCode $SVN_URL |
---|
| 1059 | if [ $? -ne 0 ]; then |
---|
| 1060 | errorAndLog "Error while getting code from svn" |
---|
| 1061 | exit 1 |
---|
| 1062 | fi |
---|
| 1063 | else |
---|
| 1064 | ln -fs "$(dirname $PROGRAMDIR)" opengnsys |
---|
[a01156a] | 1065 | fi |
---|
| 1066 | |
---|
[49c6891] | 1067 | # Compilar código fuente de los servicios de OpenGnSys. |
---|
[b6906f7] | 1068 | servicesCompilation |
---|
[13a01a7] | 1069 | if [ $? -ne 0 ]; then |
---|
| 1070 | errorAndLog "Error while compiling OpenGnsys services" |
---|
| 1071 | exit 1 |
---|
| 1072 | fi |
---|
[b6906f7] | 1073 | |
---|
| 1074 | # Configurando tftp |
---|
[318efac] | 1075 | tftpConfigure |
---|
[b6906f7] | 1076 | |
---|
| 1077 | # Configuración NFS |
---|
| 1078 | nfsConfigure |
---|
[13a01a7] | 1079 | if [ $? -ne 0 ]; then |
---|
| 1080 | errorAndLog "Error while configuring nfs server!" |
---|
| 1081 | exit 1 |
---|
| 1082 | fi |
---|
[b6906f7] | 1083 | |
---|
| 1084 | # Configuración ejemplo DHCP |
---|
| 1085 | dhcpConfigure |
---|
[a555f49] | 1086 | if [ $? -ne 0 ]; then |
---|
| 1087 | errorAndLog "Error while copying your dhcp server files!" |
---|
| 1088 | exit 1 |
---|
| 1089 | fi |
---|
[b6906f7] | 1090 | |
---|
[49c6891] | 1091 | # Copiar ficheros de servicios OpenGnSys Server. |
---|
[463a1d49] | 1092 | openGnsysCopyServerFiles ${INSTALL_TARGET} |
---|
| 1093 | if [ $? -ne 0 ]; then |
---|
| 1094 | errorAndLog "Error while copying the server files!" |
---|
| 1095 | exit 1 |
---|
| 1096 | fi |
---|
| 1097 | |
---|
[49c6891] | 1098 | # Instalar Base de datos de OpenGnSys Admin. |
---|
[b6906f7] | 1099 | isInArray notinstalled "mysql-server" |
---|
| 1100 | if [ $? -eq 0 ]; then |
---|
| 1101 | mysqlSetRootPassword ${MYSQL_ROOT_PASSWORD} |
---|
| 1102 | else |
---|
| 1103 | mysqlGetRootPassword |
---|
| 1104 | fi |
---|
[463a1d49] | 1105 | |
---|
[a01156a] | 1106 | mysqlTestConnection ${MYSQL_ROOT_PASSWORD} |
---|
| 1107 | if [ $? -ne 0 ]; then |
---|
| 1108 | errorAndLog "Error while connection to mysql" |
---|
| 1109 | exit 1 |
---|
| 1110 | fi |
---|
[892606b9] | 1111 | mysqlDbExists ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} |
---|
[a01156a] | 1112 | if [ $? -ne 0 ]; then |
---|
[cc7eab7] | 1113 | echoAndLog "Creating Web Console database" |
---|
[892606b9] | 1114 | mysqlCreateDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} |
---|
[a01156a] | 1115 | if [ $? -ne 0 ]; then |
---|
[cc7eab7] | 1116 | errorAndLog "Error while creating Web Console database" |
---|
[a01156a] | 1117 | exit 1 |
---|
| 1118 | fi |
---|
| 1119 | else |
---|
[cc7eab7] | 1120 | echoAndLog "Web Console database exists, ommiting creation" |
---|
[a01156a] | 1121 | fi |
---|
| 1122 | |
---|
[892606b9] | 1123 | mysqlCheckUserExists ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DB_USER} |
---|
[a01156a] | 1124 | if [ $? -ne 0 ]; then |
---|
| 1125 | echoAndLog "Creating user in database" |
---|
[892606b9] | 1126 | mysqlCreateAdminUserToDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} ${OPENGNSYS_DB_USER} "${OPENGNSYS_DB_PASSWD}" |
---|
[a01156a] | 1127 | if [ $? -ne 0 ]; then |
---|
[cc7eab7] | 1128 | errorAndLog "Error while creating database user" |
---|
[a01156a] | 1129 | exit 1 |
---|
| 1130 | fi |
---|
| 1131 | |
---|
| 1132 | fi |
---|
| 1133 | |
---|
[892606b9] | 1134 | mysqlCheckDbIsEmpty ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} |
---|
[a01156a] | 1135 | if [ $? -eq 0 ]; then |
---|
| 1136 | echoAndLog "Creating tables..." |
---|
[892606b9] | 1137 | if [ -f $WORKDIR/$OPENGNSYS_DB_CREATION_FILE ]; then |
---|
| 1138 | mysqlImportSqlFileToDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} $WORKDIR/$OPENGNSYS_DB_CREATION_FILE |
---|
[a01156a] | 1139 | else |
---|
[892606b9] | 1140 | errorAndLog "Unable to locate $WORKDIR/$OPENGNSYS_DB_CREATION_FILE!!" |
---|
[a01156a] | 1141 | exit 1 |
---|
| 1142 | fi |
---|
[bc7dfe7] | 1143 | else |
---|
| 1144 | # Si existe fichero ogBDAdmin-VersLocal-VersRepo.sql; aplicar cambios. |
---|
| 1145 | INSTVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt) |
---|
| 1146 | REPOVERSION=$(awk '{print $2}' $WORKDIR/opengnsys/doc/VERSION.txt) |
---|
| 1147 | OPENGNSYS_DB_UPDADE_FILE="opengnsys/admin/Database/ogBDAdmin-$INSTVERSION-$REPOVERSION.sql" |
---|
| 1148 | if [ -f $WORKDIR/$OPENGNSYS_DB_UPDADE_FILE ]; then |
---|
| 1149 | echoAndLog "Updating tables from version $INSTVERSION to $REPOVERSION" |
---|
| 1150 | mysqlImportSqlFileToDb ${MYSQL_ROOT_PASSWORD} ${OPENGNSYS_DATABASE} $WORKDIR/$OPENGNSYS_DB_UPDADE_FILE |
---|
| 1151 | else |
---|
| 1152 | echoAndLog "Database unchanged." |
---|
| 1153 | fi |
---|
[a01156a] | 1154 | fi |
---|
| 1155 | |
---|
| 1156 | # copiando paqinas web |
---|
[7586ca3] | 1157 | installWebFiles |
---|
[5d6bf97] | 1158 | # Generar páqinas web de documentación de la API |
---|
| 1159 | makeDoxygenFiles |
---|
[a01156a] | 1160 | |
---|
| 1161 | # creando configuracion de apache2 |
---|
[892606b9] | 1162 | openGnsysInstallWebConsoleApacheConf $INSTALL_TARGET /etc/apache2 |
---|
[a01156a] | 1163 | if [ $? -ne 0 ]; then |
---|
[49c6891] | 1164 | errorAndLog "Error configuring Apache for OpenGnSYS Admin" |
---|
[a01156a] | 1165 | exit 1 |
---|
| 1166 | fi |
---|
| 1167 | |
---|
| 1168 | popd |
---|
[892606b9] | 1169 | |
---|
| 1170 | # Creando la estructura del cliente |
---|
| 1171 | openGnsysClientCreate |
---|
[a555f49] | 1172 | if [ $? -ne 0 ]; then |
---|
| 1173 | errorAndLog "Error creating clients" |
---|
| 1174 | exit 1 |
---|
| 1175 | fi |
---|
[892606b9] | 1176 | |
---|
[49c6891] | 1177 | # Configuración de servicios de OpenGnSys |
---|
[cc7eab7] | 1178 | openGnsysConfigure |
---|
[2308fc7] | 1179 | |
---|
[180a07dd] | 1180 | # Mostrar sumario de la instalación e instrucciones de post-instalación. |
---|
| 1181 | installationSummary |
---|
| 1182 | |
---|
[077dd7c5] | 1183 | #rm -rf $WORKDIR |
---|
[49c6891] | 1184 | echoAndLog "OpenGnSys installation finished at $(date)" |
---|
[2308fc7] | 1185 | |
---|