wmifs: Add auto interface.

Patch by Tom Marshall <tommy@home.tig-grr.com>.  First appeared in Debian
package version 1.3b1-15.

For more information, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204873
This commit is contained in:
Doug Torrance 2014-10-22 16:34:38 -05:00 committed by Carlos R. Mafra
parent 279d4dee91
commit 09ab3c0549

View file

@ -74,6 +74,10 @@
---- ----
Changes: Changes:
--- ---
02/29/2004 (Tom Marshall, tommy@home.tig-grr.com)
* Patch to add a special interface name "auto" for the -i
option. "wmifs -i auto" will automatically select the
first up interface.
01/08/2004 (Peter Samuelson, peter@samba-tng.org) 01/08/2004 (Peter Samuelson, peter@samba-tng.org)
* Patch to make make sampling and scrolling intervals * Patch to make make sampling and scrolling intervals
customizable, adds new options -I and -s. customizable, adds new options -I and -s.
@ -399,9 +403,13 @@ void wmifs_routine(int argc, char **argv) {
stat_current = 0; stat_current = 0;
if (active_interface) { if (active_interface) {
int isauto = !strcmp(active_interface, "auto");
for (i=0; i<stat_online; i++) { for (i=0; i<stat_online; i++) {
if (!strcmp(stat_devices[i].name, active_interface)) if ((isauto && stillonline(stat_devices[i].name)) ||
!strcmp(stat_devices[i].name, active_interface)) {
stat_current = i; stat_current = i;
break;
}
} }
} }