#!/bin/bash # Script para monitorear cambios de IP pública y notificar LAST_IP_FILE="/var/run/last_public_ip" CURRENT_IP=$(curl -s https://api.ipify.org) if [ -f "$LAST_IP_FILE" ]; then LAST_IP=$(cat "$LAST_IP_FILE") if [ "$CURRENT_IP" != "$LAST_IP" ]; then echo "IP cambiada: $LAST_IP -> $CURRENT_IP" # Notificar vía n8n webhook, telegram, etc. # curl -X POST https://n8n.consultoria-as.com/webhook/ip-change ... echo "$CURRENT_IP" > "$LAST_IP_FILE" fi else echo "$CURRENT_IP" > "$LAST_IP_FILE" fi