#!/bin/sh export TERM=linux STATUS=$(nmcli radio wifi) if [[ $STATUS == disabled ]]; then echo 'Radio was off, turning on' nmcli radio wifi on echo 'Waiting for results' nmcli dev wifi list --rescan yes else nmcli dev wifi list fi
Programming Tips - Linux: turn on Wi-Fi if its off / ensure Wi-Fi is on
Date: 2024jun12
Language: bash
Q. Linux: turn on Wi-Fi if its off / ensure Wi-Fi is on
A. Here's a bash script that will turn on Wi-Fi if its off.
It uses the Network Manager command line interface.