From 753abb483d18252f2ac2b3411608f647b71ea989 Mon Sep 17 00:00:00 2001 From: "tiago.aica" Date: Sun, 15 Feb 2026 15:54:58 +0000 Subject: [PATCH] =?UTF-8?q?verifica=20se=20wifi=20est=C3=A1=20down=20e=20i?= =?UTF-8?q?nicia=20quando=20perde=20ip=20no=20eth0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/set_mac_wifi.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/set_mac_wifi.sh b/debian/set_mac_wifi.sh index 14403aa..b64b513 100644 --- a/debian/set_mac_wifi.sh +++ b/debian/set_mac_wifi.sh @@ -228,7 +228,20 @@ monitor_network_task() { log "Monitor: Wi-Fi ($WLAN_IFACE) já está desativado ou não encontrado." fi else - log "Monitor: Interface $IFACE ativa mas sem IP. Wi-Fi permanece ativo." + log "Monitor: Interface $IFACE ativa mas sem IP. Wi-Fi permanece ativo ou inicia ativação." + if ip link show "$WLAN_IFACE" &> /dev/null; then + if ip link show "$WLAN_IFACE" | grep -q "DOWN"; then + if ip link set "$WLAN_IFACE" up; then + log "Monitor: Wi-Fi ($WLAN_IFACE) ativado com sucesso." + else + log "Monitor: Falha ao ativar Wi-Fi ($WLAN_IFACE)." + fi + else + log "Monitor: Wi-Fi ($WLAN_IFACE) já está ativo." + fi + else + log "Monitor: Interface $WLAN_IFACE não encontrada." + fi fi fi else