Ho appena rilasciato un'utilità della riga di comando, mac-wifi
, ospitata al link , che soddisfa queste esigenze (almeno per me , in questo momento, sentiti libero di offrire suggerimenti). È uno script Ruby e può essere installato in uno di questi modi:
-
gem install mac-wifi
-
curl https://raw.githubusercontent.com/keithrbennett/macwifi/master/bin/mac-wifi -o mac-wifi && chmod +x mac-wifi
Per l'uso interattivo (ha una shell per mantenerlo più semplice digitare più comandi) è necessario installare pry
gem:
gem install pry
Ecco il suo output di aiuto:
mac-wifi version 1.1.0 -- Available commands are:
ci - connected to Internet (not just wifi on)?
co[nnect] network-name - turns wifi on, connects to network-name
cy[cle] - turns wifi off, then on, preserving network selection
d[isconnect] - disconnects from current network, does not turn off wifi
h[elp] - prints this help
i[nfo] - prints wifi-related information
lsp[referred] - lists preferred (not necessarily available) networks
lsa[vailable] - lists available networks
n[etwork_name] - name (SSID) of currently connected network
on - turns wifi on
of[f] - turns wifi off
pa[ssword] network-name - shows password for preferred network-name
q[uit] - exits this program (interactive shell mode only)
r[m] network-name - removes network-name from the preferred networks list
s[hell] - opens an interactive pry shell (command line only)
t[ill] - returns when the desired Internet connection state is true. Options:
'on'/:on or 'off'/:off
wait interval, in seconds (optional, defaults to 0.5 seconds)
w[ifion] - is the wifi on?
x[it] - exits this program (interactive shell mode only)
When in interactive shell mode:
* use quotes for string parameters such as method names.
* for pry commands, use prefix '%'.