Skip to content

Commit

Permalink
rfkill before trying to bring the interface up
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Nov 16, 2016
1 parent 400448d commit 20508f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gobonet_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ static int const connect(char const *const config, char const *const interface)
}

static int const scan() {
run(GOBONET_RFKILL, "unblock", "all", NULL);
return run(GOBONET_IWLIST, "scan", NULL);
}

Expand All @@ -116,6 +115,7 @@ static int const scan_command(int const argc, char const *const *const argv, boo

uid_t const uid = getuid();
setuid(0);
run(GOBONET_RFKILL, "unblock", "all", NULL);
if (ifconfig(interface, "up") != 0) return 1;
if (is_quick_scan) {
setuid(uid); /* drop privileges */
Expand Down

0 comments on commit 20508f1

Please sign in to comment.