mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
torctrl: Add stop action.
This commit is contained in:
@@ -165,5 +165,5 @@ wirelessclient: wirelessclient.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
dnsmasqctrl: dnsmasqctrl.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
$(COMPILE) -I../install+setup/libsmooth/ dnsmasqctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||
|
||||
torctrl: toctrl.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
torctrl: torctrl.c setuid.o ../install+setup/libsmooth/varval.o
|
||||
$(COMPILE) -I../install+setup/libsmooth/ torctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||
|
||||
@@ -17,14 +17,18 @@ int main(int argc, char *argv[]) {
|
||||
exit(1);
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "\nNo argument given.\n\ntorctrl (restart)\n\n");
|
||||
fprintf(stderr, "\nNo argument given.\n\ntorctrl (restart|stop)\n\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "restart") == 0) {
|
||||
safe_system("/etc/rc.d/init.d/tor reload-or-restart");
|
||||
|
||||
} else if (strcmp(argv[1], "stop") == 0) {
|
||||
safe_system("/etc/rc.d/init.d/tor stop");
|
||||
|
||||
} else {
|
||||
fprintf(stderr, "\nBad argument given.\n\ntorctrl (restart)\n\n");
|
||||
fprintf(stderr, "\nBad argument given.\n\ntorctrl (restart|stop)\n\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user