IceGuye Blog

A Bash Script to Check and Reconnect Wifi Every Minute

#!/bin/bash

WIFI_NAME="Your Wifi's Name"

while true; do
    if ! nmcli connection show --active | grep -q "$WIFI_NAME"; then
    echo "WiFi disconnected. Reconnecting..."

    nmcli connection up "$WIFI_NAME"
    fi
    sleep 60
done



Back to Blog's index