From 9c8997d54dc9df184bfcedeabf0b3c85cf5e6753 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 10 Oct 2012 12:32:29 +0000 Subject: packages: sort network related packages into package/network/ git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33688 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/network/services/hostapd/files/multicall.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/network/services/hostapd/files/multicall.c (limited to 'package/network/services/hostapd/files/multicall.c') diff --git a/package/network/services/hostapd/files/multicall.c b/package/network/services/hostapd/files/multicall.c new file mode 100644 index 000000000..c8e814bb5 --- /dev/null +++ b/package/network/services/hostapd/files/multicall.c @@ -0,0 +1,28 @@ +#include +#include +#include + +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 []\n", prog); + return 255; +} -- cgit v1.2.3