parent
142e3bb88b
commit
d50d21f081
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,78 @@
|
||||
==========================================
|
||||
BACKUP DE VICIBOX - AMBIENTE DE CONFIGURACIÓN
|
||||
==========================================
|
||||
|
||||
Fecha de creación: Fri Feb 6 04:46:49 PM UTC 2026
|
||||
|
||||
ARCHIVOS INCLUIDOS:
|
||||
-------------------
|
||||
1. vicibox-scripts.tar.gz
|
||||
- Todos los scripts de instalación y configuración de Vicibox
|
||||
- Ubicación original: /usr/share/vicibox/
|
||||
|
||||
2. astguiclient-trunk.tar.gz
|
||||
- Código fuente completo de ViciDial
|
||||
- Ubicación original: /usr/src/astguiclient/trunk/
|
||||
|
||||
3. restore.sh
|
||||
- Script para restaurar los archivos en el servidor destino
|
||||
|
||||
4. install-vicibox.sh (NUEVO)
|
||||
- Instalación completa en orden: Perl → MariaDB → PHP → Apache
|
||||
- Configura Apache para apuntar a /vicidial/welcome.php
|
||||
- Ejecuta restore.sh, aplica parches a vicibox-install.pl y lanza --vicibox-express
|
||||
- Uso: sudo ./install-vicibox.sh
|
||||
|
||||
5. apply-vicibox-patches.sh (NUEVO)
|
||||
- Aplica parches a vicibox-install.pl (socket MySQL, random_pass, DBI)
|
||||
- Se usa automáticamente desde install-vicibox.sh si no existe patches/vicibox-install.pl
|
||||
|
||||
6. create-admin-sapian.sh (NUEVO)
|
||||
- Crea usuario administrador en ViciDial: sapian / sap64adm (user_level 9).
|
||||
- Se ejecuta al final de install-vicibox.sh. También se puede ejecutar a mano: sudo ./create-admin-sapian.sh
|
||||
|
||||
7. patches/
|
||||
- vicibox-install.pl: copia del instalador con parches ya aplicados (recomendado)
|
||||
- README.txt: descripción de los parches
|
||||
|
||||
8. version-info.txt
|
||||
- Información de versiones y sistema
|
||||
|
||||
INSTRUCCIONES RÁPIDAS (instalación automática):
|
||||
----------------------------------------------
|
||||
1. Copiar este directorio al servidor destino (ej. /home/backvicibox).
|
||||
|
||||
2. Ejecutar el instalador (instala dependencias, restore, parches y express):
|
||||
cd /home/backvicibox
|
||||
sudo chmod +x install-vicibox.sh restore.sh apply-vicibox-patches.sh
|
||||
sudo ./install-vicibox.sh
|
||||
|
||||
3. Revisar el log si algo falla: install-vicibox.log
|
||||
|
||||
INSTRUCCIONES MANUALES (paso a paso):
|
||||
------------------------------------
|
||||
1. Instalar dependencias: Perl (y DBI, DBD-mysql, LWP::Simple), Subversion,
|
||||
MariaDB, PHP 8 (y apache2-mod_php8, php8-mysql), Apache2.
|
||||
2. Configurar Apache para que la URL principal sirva /vicidial/welcome.php.
|
||||
3. Ejecutar: sudo ./restore.sh
|
||||
4. Aplicar parches (copiar patches/vicibox-install.pl a /usr/share/vicibox/
|
||||
o ejecutar apply-vicibox-patches.sh).
|
||||
5. Ejecutar: echo y | sudo /usr/share/vicibox/vicibox-install.pl --vicibox-express
|
||||
6. En /etc/astguiclient.conf poner VARDB_server => 127.0.0.1 para la web.
|
||||
|
||||
REQUISITOS DEL SERVIDOR DESTINO:
|
||||
--------------------------------
|
||||
- Sistema operativo: openSUSE Leap / SUSE Linux Enterprise (SLE 15 SP6)
|
||||
- install-vicibox.sh instala: Perl, DBI, DBD-mysql, libwww-perl, subversion,
|
||||
MariaDB, PHP 8, Apache2. Asterisk se gestiona por el instalador ViciBox.
|
||||
- Acceso a internet (recomendado para repos y actualizaciones).
|
||||
|
||||
NOTAS:
|
||||
------
|
||||
- El tamaño total comprimido es aproximadamente 50-70 MB.
|
||||
- Log de install-vicibox.sh: install-vicibox.log en este directorio.
|
||||
- Log del instalador ViciBox: /var/log/vicibox.log.
|
||||
- Acceso web tras instalación: http://<IP>/vicidial/welcome.php
|
||||
- Usuario administrador ViciDial (creado al final): sapian / sap64adm (admin.php)
|
||||
|
||||
==========================================
|
||||
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Aplica los parches necesarios a /usr/share/vicibox/vicibox-install.pl
|
||||
# (detección socket MySQL/MariaDB, random_pass sin pwgen, DBI con socket)
|
||||
#
|
||||
# Uso: sudo ./apply-vicibox-patches.sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
INSTALL_PL="/usr/share/vicibox/vicibox-install.pl"
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Ejecutar como root."
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "$INSTALL_PL" ]; then
|
||||
echo "No se encuentra $INSTALL_PL. Ejecuta primero restore.sh."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Si ya tiene los parches (socket y random_pass), no hacer nada
|
||||
if grep -q 'mysql_socket' "$INSTALL_PL" && grep -q 'sub random_pass' "$INSTALL_PL"; then
|
||||
echo "vicibox-install.pl ya tiene los parches aplicados."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
BACKUP="${INSTALL_PL}.bak.$(date +%Y%m%d%H%M%S)"
|
||||
cp -a "$INSTALL_PL" "$BACKUP"
|
||||
echo "Copia de seguridad: $BACKUP"
|
||||
|
||||
# 1) Insertar detección de socket después de "$VICIport = 3306;"
|
||||
perl -i -0pe 's/(\$VICIport = 3306;\n)(\$VICIuser = "cron";)/$1# Detect MySQL\/MariaDB socket (openSUSE uses \/var\/run\/mysql\/mysql.sock, others may use \/run\/mysql\/mysql.sock)\n\$mysql_socket = "";\nforeach my \$sock ("\/var\/run\/mysql\/mysql.sock", "\/run\/mysql\/mysql.sock", "\/var\/lib\/mysql\/mysql.sock", "\/tmp\/mysql.sock") {\n\tif (-S \$sock) { \$mysql_socket = \$sock; last; }\n}\n$2/s' "$INSTALL_PL"
|
||||
|
||||
# 2) Insertar sub random_pass después de "return \$string;\n}\n\n# Get the admin"
|
||||
perl -i -0pe 's/(return \$string;\n\}\n\n)(# Get the admin\.php build)/$1# Generate random password string; use pwgen if available, else openssl, else Perl fallback\nsub random_pass {\n\tmy \$len = \$_\[0\] \|\| 15;\n\tif (-x \"\/usr\/bin\/pwgen\") {\n\t\tmy \$s = trim(\`\/usr\/bin\/pwgen -cns \$len 1\`);\n\t\treturn \$s if \$s;\n\t}\n\tif (-x \"\/usr\/bin\/openssl\") {\n\t\tmy \$s = trim(\`\/usr\/bin\/openssl rand -base64 \$len\`);\n\t\t\$s =~ s\/\[^a-zA-Z0-9\]\/\/g;\n\t\treturn substr(\$s, 0, \$len) if length(\$s) >= \$len;\n\t}\n\tmy \@c = (\x27a\x27..\x27z\x27, \x27A\x27..\x27Z\x27, 0..9);\n\treturn join(\x27\x27, map { \$c[rand \@c] } 1..\$len);\n}\n\n$2/s' "$INSTALL_PL"
|
||||
|
||||
# 3) Primera conexión DBI (root) -> usar dsn_root
|
||||
perl -i -0pe 's/\t\t\$dbhVDnew = DBI->connect\("DBI:mysql::localhost:\$VICIport", "root", ""\) or die "Couldn\x27t connect to MySQL to create database: " \. DBI->errstr;\n\t\tif \(\$DBS==0\)/\t\tmy \$dsn_root = "DBI:mysql::localhost:\$VICIport" \. (\$mysql_socket ? ";mysql_socket=\$mysql_socket" : "");\n\t\t\$dbhVDnew = DBI->connect(\$dsn_root, "root", "") or die "Couldn\x27t connect to MySQL to create database: " \. DBI->errstr;\n\t\tif (\$DBS==0)/s' "$INSTALL_PL"
|
||||
|
||||
# 4) Reconnect to new database -> dsn_db
|
||||
perl -i -0pe 's/\t\t# Reconnect to the new database\n\t\t\$dbhVDnew->disconnect;\n\t\t\$dbhVDnew = DBI->connect\("DBI:mysql:\$VICIdatabase:localhost:\$VICIport", "root", ""\) or die "Couldn\x27t reconnect to MySQL to create database tables: " \. DBI->errstr;/# Reconnect to the new database\n\t\t\$dbhVDnew->disconnect;\n\t\tmy \$dsn_db = "DBI:mysql:\$VICIdatabase:localhost:\$VICIport" \. (\$mysql_socket ? ";mysql_socket=\$mysql_socket" : "");\n\t\t\$dbhVDnew = DBI->connect(\$dsn_db, "root", "") or die "Couldn\x27t reconnect to MySQL to create database tables: " \. DBI->errstr;/s' "$INSTALL_PL"
|
||||
|
||||
# 5) Slave reconnect -> dsn_root2
|
||||
perl -i -0pe 's/\t\t\t# release and reconnect since we restarted the server\n\t\t\t\$dbhVDnew->disconnect;\n\t\t\t\$dbhVDnew = DBI->connect\("DBI:mysql::localhost:\$VICIport", "root", ""\) or die "Couldn\x27t connect to MySQL to create database: " \. DBI->errstr;\n\t\t\t# Reset the slave/\t\t\t# release and reconnect since we restarted the server\n\t\t\t\$dbhVDnew->disconnect;\n\t\t\tmy \$dsn_root2 = "DBI:mysql::localhost:\$VICIport" \. (\$mysql_socket ? ";mysql_socket=\$mysql_socket" : "");\n\t\t\t\$dbhVDnew = DBI->connect(\$dsn_root2, "root", "") or die "Couldn\x27t connect to MySQL to create database: " \. DBI->errstr;\n\t\t\t# Reset the slave/s' "$INSTALL_PL"
|
||||
|
||||
# 6) pwgen -> random_pass (dos líneas de passwords)
|
||||
perl -i -pe 's/my \$randomstring1=trim\(`\/usr\/bin\/pwgen -cns 15 1`\);/my \$randomstring1=random_pass(15);/; s/my \$randomstring2=trim\(`\/usr\/bin\/pwgen -cns 15 1`\);/my \$randomstring2=random_pass(15);/' "$INSTALL_PL"
|
||||
|
||||
# 7) Conexión cron (dbhVD) -> dsn_cron
|
||||
perl -i -0pe 's/\t\t\t\t# At this point the primary should be up and good, so we set-up our normal DBI connection for later processes\n\t\t\t\t# Also a good double-check procedure that stuff works\n\t\t\t\t\$dbhVD = DBI->connect\("DBI:mysql:\$VICIdatabase:localhost:\$VICIport", "\$VICIuser", "\$VICIpass"\) or die "Couldn\x27t connect to ViciDial database: " \. DBI->errstr;/# At this point the primary should be up and good, so we set-up our normal DBI connection for later processes\n\t\t\t\t# Also a good double-check procedure that stuff works\n\t\t\t\tmy \$dsn_cron = "DBI:mysql:\$VICIdatabase:localhost:\$VICIport" \. (\$mysql_socket ? ";mysql_socket=\$mysql_socket" : "");\n\t\t\t\t\$dbhVD = DBI->connect(\$dsn_cron, "\$VICIuser", "\$VICIpass") or die "Couldn\x27t connect to ViciDial database: " \. DBI->errstr;/s' "$INSTALL_PL"
|
||||
|
||||
# 8) Más pwgen -> random_pass
|
||||
perl -i -pe 's/\$randomstring=trim\(`pwgen -cns 32 1`\);/\$randomstring=random_pass(32);/; s/\$randomstring=trim\(`\/usr\/bin\/pwgen -cns 15 1`\);/\$randomstring=random_pass(15);/g' "$INSTALL_PL"
|
||||
|
||||
echo "Parches aplicados correctamente a $INSTALL_PL"
|
||||
Binary file not shown.
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Crea el usuario administrador en ViciDial: sapian / sap64adm
|
||||
# Debe ejecutarse después de que la base de datos asterisk y la tabla vicidial_users existan.
|
||||
#
|
||||
# Uso: sudo ./create-admin-sapian.sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Usar 127.0.0.1 para evitar problemas de socket con MariaDB
|
||||
MYSQL_OPTS="-h 127.0.0.1 -u root"
|
||||
DB="asterisk"
|
||||
USER="sapian"
|
||||
PASS="sap64adm"
|
||||
FULL_NAME="Sapian Admin"
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Ejecutar como root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! mariadb $MYSQL_OPTS -e "USE $DB" 2>/dev/null; then
|
||||
echo "La base de datos $DB no existe o no hay acceso. Ejecutar después de la instalación Express."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Crear usuario administrador (user_level 9 = admin). Si ya existe, actualizar contraseña.
|
||||
mariadb $MYSQL_OPTS "$DB" << EOF
|
||||
INSERT INTO vicidial_users (user, pass, full_name, user_level, user_group, load_leads, campaign_detail, ast_admin_access, modify_users, alter_agent_interface_options, active)
|
||||
VALUES ('$USER', '$PASS', '$FULL_NAME', '9', 'ADMIN', '1', '1', '1', '1', '1', 'Y')
|
||||
ON DUPLICATE KEY UPDATE pass = VALUES(pass), full_name = VALUES(full_name), user_level = 9, active = 'Y',
|
||||
load_leads = '1', campaign_detail = '1', ast_admin_access = '1', modify_users = '1', alter_agent_interface_options = '1';
|
||||
EOF
|
||||
|
||||
echo "Usuario administrador creado/actualizado: $USER (password: $PASS)"
|
||||
echo "Acceso: http://<IP>/vicidial/admin.php — iniciar sesión con $USER / $PASS"
|
||||
@ -0,0 +1,190 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Script de instalación completa de ViciBox (ambiente de configuración)
|
||||
# Basado en la carpeta backvicibox.
|
||||
#
|
||||
# Orden: Perl (DBI/DBD-mysql/libwww) → MariaDB → PHP → Apache → Asterisk
|
||||
# → restore.sh → parches a vicibox-install.pl → vicibox-install --vicibox-express
|
||||
#
|
||||
# Uso: sudo ./install-vicibox.sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
LOG_FILE="${SCRIPT_DIR}/install-vicibox.log"
|
||||
|
||||
info() { echo -e "${GREEN}[INFO]${NC} $1" | tee -a "$LOG_FILE"; }
|
||||
warn() { echo -e "${YELLOW}[WARN]${NC} $1" | tee -a "$LOG_FILE"; }
|
||||
error() { echo -e "${RED}[ERROR]${NC} $1" | tee -a "$LOG_FILE"; }
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
error "Ejecutar como root: sudo $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Comprobar que estamos en backvicibox y existen archivos
|
||||
if [ ! -f "${SCRIPT_DIR}/restore.sh" ]; then
|
||||
error "No se encuentra restore.sh. Ejecutar desde el directorio backvicibox."
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "${SCRIPT_DIR}/vicibox-scripts.tar.gz" ] || [ ! -f "${SCRIPT_DIR}/astguiclient-trunk.tar.gz" ]; then
|
||||
error "Faltan vicibox-scripts.tar.gz o astguiclient-trunk.tar.gz en ${SCRIPT_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "=========================================="
|
||||
info "Instalación ViciBox (dependencias + restore + express)"
|
||||
info "=========================================="
|
||||
echo ""
|
||||
|
||||
# --- 0. Módulos Perl (antes que todo) ---
|
||||
info "0. Instalando módulos Perl requeridos (perl-DBI, perl-DBD-mysql, perl-libwww-perl)..."
|
||||
zypper -n install -y perl-DBI perl-DBD-mysql perl-libwww-perl >> "$LOG_FILE" 2>&1 || true
|
||||
info " perl-DBI, perl-DBD-mysql, perl-libwww-perl instalados"
|
||||
echo ""
|
||||
|
||||
# --- 1. Perl (versión del sistema) y resto de módulos ---
|
||||
info "1. Instalando Perl, Subversion y resto de dependencias..."
|
||||
zypper -n install -y perl perl-DBI perl-DBD-mysql libwww-perl subversion >> "$LOG_FILE" 2>&1 || true
|
||||
info " Perl: $(perl -v 2>&1 | head -1)"
|
||||
echo ""
|
||||
|
||||
# --- 2. MariaDB ---
|
||||
info "2. Instalando MariaDB..."
|
||||
zypper -n install -y mariadb mariadb-client >> "$LOG_FILE" 2>&1
|
||||
systemctl enable mariadb >> "$LOG_FILE" 2>&1
|
||||
systemctl start mariadb >> "$LOG_FILE" 2>&1
|
||||
info " MariaDB instalado y en ejecución"
|
||||
echo ""
|
||||
|
||||
# --- 3. PHP 8 y módulo Apache ---
|
||||
info "3. Instalando PHP 8 y módulo Apache..."
|
||||
if ! zypper lr | grep -q "devel_languages_php_php80"; then
|
||||
zypper -n addrepo https://download.opensuse.org/repositories/devel:languages:php:php80/SLE_15_SP6/devel:languages:php:php80.repo
|
||||
fi
|
||||
zypper --no-gpg-checks -n refresh >> "$LOG_FILE" 2>&1
|
||||
zypper -n install -y php8 apache2-mod_php8 php8-mysql >> "$LOG_FILE" 2>&1
|
||||
info " PHP $(php8 -v 2>/dev/null | head -1 || true) instalado"
|
||||
echo ""
|
||||
|
||||
# --- 4. Apache ---
|
||||
info "4. Instalando Apache y configurando welcome.php..."
|
||||
zypper -n install -y apache2 apache2-prefork >> "$LOG_FILE" 2>&1
|
||||
# Configurar que la raíz y /vicidial apunten a welcome.php
|
||||
cat > /etc/apache2/conf.d/vicidial-welcome.conf << 'APACHECONF'
|
||||
# ViciDial: URL principal -> vicidial/welcome.php
|
||||
<Directory "/srv/www/htdocs/vicidial">
|
||||
DirectoryIndex welcome.php
|
||||
Options None
|
||||
<IfModule !mod_access_compat.c>
|
||||
Require all granted
|
||||
</IfModule>
|
||||
</Directory>
|
||||
RedirectMatch ^/$ /vicidial/welcome.php
|
||||
APACHECONF
|
||||
systemctl enable apache2 >> "$LOG_FILE" 2>&1
|
||||
systemctl start apache2 >> "$LOG_FILE" 2>&1
|
||||
info " Apache instalado y apuntando a /vicidial/welcome.php"
|
||||
echo ""
|
||||
|
||||
# --- 4b. Asterisk (requerido por vicibox-install; el instalador no lo instala) ---
|
||||
info "4b. Instalando Asterisk (repositorio VICIdial asterisk-18)..."
|
||||
AST_REPO_NAME="home:vicidial:asterisk-18"
|
||||
AST_REPO_URL="https://download.opensuse.org/repositories/${AST_REPO_NAME}"
|
||||
# Detectar versión (ej. 16.0 en openSUSE Leap 16.0)
|
||||
AST_OS_VER=""
|
||||
[ -f /etc/os-release ] && AST_OS_VER=$(grep -E '^VERSION_ID=' /etc/os-release | cut -d'"' -f2)
|
||||
# Probar versión del sistema primero; luego 16.0, 15.6, 15.5
|
||||
AST_VERSIONS="$AST_OS_VER 16.0 15.6 15.5"
|
||||
AST_REPO_ADDED=0
|
||||
for AST_VER in $AST_VERSIONS; do
|
||||
[ -z "$AST_VER" ] && continue
|
||||
if zypper lr 2>/dev/null | grep -q "$AST_REPO_NAME"; then
|
||||
AST_REPO_ADDED=1
|
||||
break
|
||||
fi
|
||||
info " Añadiendo repo: ${AST_REPO_NAME} (${AST_VER})..."
|
||||
zypper -n addrepo --refresh "${AST_REPO_URL}/${AST_VER}/${AST_REPO_NAME}.repo" >> "$LOG_FILE" 2>&1 && AST_REPO_ADDED=1 && break
|
||||
done
|
||||
if [ "$AST_REPO_ADDED" = "1" ] && zypper lr 2>/dev/null | grep -q "$AST_REPO_NAME"; then
|
||||
info " Refrescando repositorios..."
|
||||
zypper --no-gpg-checks -n refresh >> "$LOG_FILE" 2>&1
|
||||
info " Instalando asterisk..."
|
||||
zypper -n install -y asterisk >> "$LOG_FILE" 2>&1
|
||||
info " Habilitando e iniciando asterisk..."
|
||||
systemctl enable asterisk >> "$LOG_FILE" 2>&1
|
||||
systemctl start asterisk >> "$LOG_FILE" 2>&1 || true
|
||||
info " Asterisk: $(asterisk -V 2>/dev/null || echo 'revisar servicio')"
|
||||
else
|
||||
warn " Repo Asterisk no disponible. Para Leap 16.0 ejecuta manualmente:"
|
||||
warn " zypper ar --refresh ${AST_REPO_URL}/16.0/${AST_REPO_NAME}.repo"
|
||||
warn " zypper --no-gpg-checks ref && zypper in -y asterisk && systemctl enable --now asterisk"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# --- 5. Restore (scripts y código fuente) ---
|
||||
info "5. Ejecutando restore.sh..."
|
||||
cd "$SCRIPT_DIR"
|
||||
./restore.sh >> "$LOG_FILE" 2>&1
|
||||
echo ""
|
||||
|
||||
# --- 6. Aplicar parches a vicibox-install.pl ---
|
||||
info "6. Aplicando parches a vicibox-install.pl (socket MySQL, random_pass, etc.)..."
|
||||
if [ -f "${SCRIPT_DIR}/patches/vicibox-install.pl" ]; then
|
||||
cp "${SCRIPT_DIR}/patches/vicibox-install.pl" /usr/share/vicibox/vicibox-install.pl
|
||||
chmod +x /usr/share/vicibox/vicibox-install.pl
|
||||
info " Copiado vicibox-install.pl con parches desde patches/"
|
||||
elif [ -f "${SCRIPT_DIR}/apply-vicibox-patches.sh" ]; then
|
||||
"${SCRIPT_DIR}/apply-vicibox-patches.sh" >> "$LOG_FILE" 2>&1
|
||||
info " Parches aplicados con apply-vicibox-patches.sh"
|
||||
else
|
||||
warn " No se encontró patches/vicibox-install.pl ni apply-vicibox-patches.sh."
|
||||
warn " Se usará vicibox-install.pl sin parches (puede fallar socket MySQL/pwgen)."
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# --- 7. Ejecutar instalación Express ---
|
||||
info "7. Ejecutando vicibox-install --vicibox-express (confirmación automática 'y')..."
|
||||
info " Esto puede tardar varios minutos..."
|
||||
echo "y" | /usr/share/vicibox/vicibox-install.pl --vicibox-express >> "$LOG_FILE" 2>&1 || true
|
||||
echo ""
|
||||
|
||||
# --- 8. Ajustar conexión web (127.0.0.1 para evitar error socket) ---
|
||||
if [ -f /etc/astguiclient.conf ]; then
|
||||
if grep -q 'VARDB_server => localhost' /etc/astguiclient.conf; then
|
||||
sed -i 's/VARDB_server => localhost/VARDB_server => 127.0.0.1/' /etc/astguiclient.conf
|
||||
info "8. Configuración: VARDB_server => 127.0.0.1 en /etc/astguiclient.conf (para la web)"
|
||||
fi
|
||||
else
|
||||
info "8. /etc/astguiclient.conf no existe aún (normal si la instalación Express falló antes de crearlo)."
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# --- 9. Crear usuario administrador sapian / sap64adm ---
|
||||
info "9. Creando usuario administrador sapian en ViciDial..."
|
||||
if [ -f "${SCRIPT_DIR}/create-admin-sapian.sh" ]; then
|
||||
chmod +x "${SCRIPT_DIR}/create-admin-sapian.sh"
|
||||
if "${SCRIPT_DIR}/create-admin-sapian.sh" >> "$LOG_FILE" 2>&1; then
|
||||
info " Usuario administrador: sapian / sap64adm creado correctamente"
|
||||
else
|
||||
warn " No se pudo crear el usuario (¿base de datos ya instalada?). Puedes ejecutar después: sudo ${SCRIPT_DIR}/create-admin-sapian.sh"
|
||||
fi
|
||||
else
|
||||
warn " No se encuentra create-admin-sapian.sh. Crear usuario sapian manualmente en admin.php si lo necesitas."
|
||||
fi
|
||||
echo ""
|
||||
|
||||
info "=========================================="
|
||||
info "Proceso de instalación finalizado"
|
||||
info "=========================================="
|
||||
info "Log guardado en: $LOG_FILE"
|
||||
info "Comprueba el estado de servicios: systemctl status mariadb apache2 asterisk"
|
||||
info "Acceso web: http://<IP-del-servidor>/vicidial/welcome.php"
|
||||
info "Admin ViciDial: usuario sapian, password sap64adm (admin.php)"
|
||||
echo ""
|
||||
@ -0,0 +1,14 @@
|
||||
Parches para vicibox-install.pl
|
||||
================================
|
||||
|
||||
- vicibox-install.pl (si existe): copia del script con modificaciones aplicadas para:
|
||||
* Detección automática del socket MySQL/MariaDB (/var/run/mysql, /run/mysql, etc.)
|
||||
* Función random_pass() cuando pwgen no está instalado
|
||||
* Conexiones DBI usando el socket detectado (evita "No such file or directory")
|
||||
|
||||
Si este directorio contiene vicibox-install.pl, install-vicibox.sh lo copiará
|
||||
a /usr/share/vicibox/ después de restore.sh. Si no, intentará aplicar
|
||||
apply-vicibox-patches.sh al script restaurado.
|
||||
|
||||
Para regenerar vicibox-install.pl con parches desde un sistema ya parcheado:
|
||||
cp /usr/share/vicibox/vicibox-install.pl /home/backvicibox/patches/
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Script de restauración de Vicibox para servidor destino
|
||||
# Uso: ./restore.sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Colores para output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo -e "${YELLOW}[WARN]${NC} $1"
|
||||
}
|
||||
|
||||
error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# Verificar que se ejecuta como root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
error "Este script debe ejecutarse como root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verificar que existen los archivos
|
||||
if [ ! -f "vicibox-scripts.tar.gz" ]; then
|
||||
error "No se encuentra vicibox-scripts.tar.gz"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "astguiclient-trunk.tar.gz" ]; then
|
||||
error "No se encuentra astguiclient-trunk.tar.gz"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "=========================================="
|
||||
info "Restauración de Vicibox"
|
||||
info "=========================================="
|
||||
echo ""
|
||||
|
||||
# 1. Restaurar scripts de Vicibox
|
||||
info "1. Restaurando scripts de Vicibox..."
|
||||
mkdir -p /usr/share
|
||||
if tar -xzf vicibox-scripts.tar.gz -C /usr/share/ 2>/dev/null; then
|
||||
chmod +x /usr/share/vicibox/*.sh 2>/dev/null
|
||||
chmod +x /usr/share/vicibox/*.pl 2>/dev/null
|
||||
chmod +x /usr/share/vicibox/vicibox-* 2>/dev/null
|
||||
info " ✓ Scripts restaurados"
|
||||
else
|
||||
error " ✗ Error al restaurar scripts"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 2. Crear enlaces simbólicos
|
||||
info "2. Creando enlaces simbólicos..."
|
||||
mkdir -p /usr/local/bin
|
||||
ln -sf /usr/share/vicibox/vicibox-install.pl /usr/local/bin/vicibox-install 2>/dev/null
|
||||
ln -sf /usr/share/vicibox/vicibox-express /usr/local/bin/vicibox-express 2>/dev/null
|
||||
ln -sf /usr/share/vicibox/vicibox-externip /usr/local/bin/vicibox-externip 2>/dev/null
|
||||
ln -sf /usr/share/vicibox/vicibox-timezone /usr/local/bin/vicibox-timezone 2>/dev/null
|
||||
ln -sf /usr/share/vicibox/vicibox-mdraid1 /usr/local/bin/vicibox-mdraid1 2>/dev/null
|
||||
info " ✓ Enlaces simbólicos creados"
|
||||
echo ""
|
||||
|
||||
# 3. Restaurar código fuente
|
||||
info "3. Restaurando código fuente de ViciDial..."
|
||||
mkdir -p /usr/src
|
||||
if tar -xzf astguiclient-trunk.tar.gz -C /usr/src/ 2>/dev/null; then
|
||||
chmod +x /usr/src/astguiclient/trunk/install.pl 2>/dev/null
|
||||
chmod +x /usr/src/astguiclient/trunk/bin/* 2>/dev/null || true
|
||||
chmod +x /usr/src/astguiclient/trunk/extras/*.sh 2>/dev/null || true
|
||||
info " ✓ Código fuente restaurado"
|
||||
else
|
||||
error " ✗ Error al restaurar código fuente"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 4. Verificación
|
||||
info "4. Verificando instalación..."
|
||||
ERRORS=0
|
||||
|
||||
if [ ! -f "/usr/share/vicibox/vicibox-install.pl" ]; then
|
||||
error " ✗ No se encuentra vicibox-install.pl"
|
||||
ERRORS=$((ERRORS+1))
|
||||
fi
|
||||
|
||||
if [ ! -f "/usr/src/astguiclient/trunk/install.pl" ]; then
|
||||
error " ✗ No se encuentra install.pl de ViciDial"
|
||||
ERRORS=$((ERRORS+1))
|
||||
fi
|
||||
|
||||
if [ ! -f "/usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql" ]; then
|
||||
error " ✗ No se encuentra MySQL_AST_CREATE_tables.sql"
|
||||
ERRORS=$((ERRORS+1))
|
||||
fi
|
||||
|
||||
if [ $ERRORS -eq 0 ]; then
|
||||
info " ✓ Verificación completada sin errores"
|
||||
else
|
||||
warn " ⚠ Se encontraron $ERRORS errores en la verificación"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
info "=========================================="
|
||||
info "Restauración completada!"
|
||||
info "=========================================="
|
||||
echo ""
|
||||
info "Ahora puedes ejecutar la instalación:"
|
||||
echo ""
|
||||
echo " Para instalación Express (todo-en-uno):"
|
||||
echo " vicibox-install --vicibox-express"
|
||||
echo ""
|
||||
echo " Para instalación personalizada:"
|
||||
echo " vicibox-install"
|
||||
echo ""
|
||||
@ -0,0 +1,21 @@
|
||||
=== Información de Versión ===
|
||||
Fecha de backup: Fri Feb 6 04:46:49 PM UTC 2026
|
||||
|
||||
--- Versión de Vicibox ---
|
||||
- ViciBox v.12.0.2 240121
|
||||
* MariaDB 10.11 deprecated the old TIMESTAMP behavior
|
||||
* ssh service was defined twice in the external.xml zonefile.
|
||||
- ViciBox v.12.0.1 250118
|
||||
* firewalld (the firewall) was not enabled by default. This is a policy issue and not a bug.
|
||||
* Added version into to /etc/issue and Grub. So now it'll say v.12.0.1 instead of v.12.0
|
||||
* vicibox-mdraid1 bug see https://docs.vicibox.com/en/latest/bugfix/bugfix1200-1.html
|
||||
- ViciBox v.12.0.0-Beta 250116
|
||||
|
||||
--- Versión de ViciDial ---
|
||||
2.14b0.5
|
||||
|
||||
--- Información del Sistema ---
|
||||
Linux vicibox12 6.4.0-150600.23.73-default #1 SMP PREEMPT_DYNAMIC Tue Oct 7 08:43:02 UTC 2025 (46f6a23) x86_64 x86_64 x86_64 GNU/Linux
|
||||
|
||||
--- Versión de Asterisk ---
|
||||
Asterisk 18.26.4-vici
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue