Skip to content

Commit

Permalink
fix getting wifi ssid on ubuntu
Browse files Browse the repository at this point in the history
on ubuntu and probably other systems, /bin/sh does not support `-o pipefail`

closes greshake#280
  • Loading branch information
mathroc committed Oct 8, 2018
1 parent 192274f commit 3cbc225
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/blocks/net.rs
Expand Up @@ -95,12 +95,10 @@ impl NetworkDevice {
.args(
&[
"-c",
"-o",
"pipefail",
&format!(
"iw dev {} link | grep \"^\\sSSID:\" | sed \"s/^\\sSSID:\\s//g\" || nmcli -g general.connection device show {}",
self.device,
self.device
"ssid=\$(iw dev {} link | grep \"^\\sSSID:\" | sed \"s/^\\sSSID:\\s//g\"); [ \$ssid -eq "" ] && ssid=\$(nmcli -g general.connection device show {}); echo \$ssid", self.device
),
],
)
Expand Down

0 comments on commit 3cbc225

Please sign in to comment.