proxmox-node-config/setup.sh

23 lines
621 B
Bash
Executable File

#!/bin/bash
SERVICE_NAME="network-watchdog.service"
TIMER_NAME="network-watchdog.timer"
SCRIPT_NAME="network-watchdog.sh"
INSTALL_DIR="/opt/proxmox-node-config"
echo "==> Instalando watchdog de red..."
# Copiar archivos systemd
cp "$INSTALL_DIR/systemd/$SERVICE_NAME" /etc/systemd/system/
cp "$INSTALL_DIR/systemd/$TIMER_NAME" /etc/systemd/system/
# Asegurar permisos de ejecución en el script
chmod +x "$INSTALL_DIR/$SCRIPT_NAME"
# Recargar systemd y activar timer
systemctl daemon-reexec
systemctl daemon-reload
systemctl enable --now "$TIMER_NAME"
echo "==> Watchdog de red instalado y activado correctamente."