mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-01 22:25:20 +02:00
1f0cb60a11
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19286 3c298f89-4303-0410-b956-a3cf2f4a3e73
29 lines
613 B
C
29 lines
613 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
extern int hostapd_main(int argc, char **argv);
|
|
extern int wpa_supplicant_main(int argc, char **argv);
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
bool restart = false;
|
|
const char *prog = argv[0];
|
|
|
|
restart:
|
|
if (strstr(argv[0], "hostapd"))
|
|
return hostapd_main(argc, argv);
|
|
else if (strstr(argv[0], "wpa_supplicant"))
|
|
return wpa_supplicant_main(argc, argv);
|
|
|
|
if (!restart && argc > 1) {
|
|
argv++;
|
|
argc--;
|
|
restart = true;
|
|
goto restart;
|
|
}
|
|
|
|
fprintf(stderr, "Invalid command.\nUsage: %s wpa_supplicant|hostapd [<arguments>]\n", prog);
|
|
return 255;
|
|
}
|