#include #include #include using namespace std; void usage(const string& argv0) { cout << "Usage: " << argv0 << " (freeradius|dnsmasq)" << endl; } int main(int argc, char *argv[]) { if (argc < 2) { usage(argv[0]); return 0; } string argv1 { argv[1] }; // We're setuid, prevent people from abusing this if (argv1 != "freeradius" && argv1 != "dnsmasq") { usage(argv[0]); return 1; } ostringstream s; s << "pkill -HUP " << argv1; system(s.str().c_str()); }