小编Agl*_*tas的帖子

在 Linux 中从命令行确定无线网络名称

我在家里和工作中都使用我的个人笔记本电脑,在这两种情况下我都安装了 nfs 共享。我想在每次打开笔记本电脑时自动安装这些共享。

我不能让它成为一个正常的启动命令来运行,因为无线连接需要大约半分钟才能定位网络并连接。

所以我想写一个脚本,每 5 秒检查一次我是否连接到网络以及网络的 essid 是什么,以便我可以安装适当的共享。

我查看了 iwconfig 和 ifconfig,但没有一个返回 essid,只有一个实际的 IP 地址。

ifconfig 返回...

eth0      Link encap:Ethernet  HWaddr 00:26:2d:a2:01:a8  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Interrupt:16 

eth1      Link encap:Ethernet  HWaddr f0:7b:cb:45:36:b2  
      inet addr:192.168.0.48  Bcast:192.168.3.255  Mask:255.255.252.0
      inet6 addr: fe80::f27b:cbff:fe45:36b2/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:30972 errors:0 dropped:0 overruns:0 frame:124824
      TX packets:31414 errors:16 dropped:0 …
Run Code Online (Sandbox Code Playgroud)

linux wifi command-line-interface

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

command-line-interface ×1

linux ×1

wifi ×1