X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Fmisc-progs%2Fqosctrl.c;h=f3b288bcda5f72f24fb7252301d0572a3010ddc3;hp=ac9fd37504e7ec2c778b80c8e666552ce75111e7;hb=a7fb5630d1a1eca802d2bf714dde6a50b325a2cf;hpb=92b5fba450fe2cc7b296c3f29134741e1ef16bfc diff --git a/src/misc-progs/qosctrl.c b/src/misc-progs/qosctrl.c index ac9fd37504..f3b288bcda 100644 --- a/src/misc-progs/qosctrl.c +++ b/src/misc-progs/qosctrl.c @@ -26,28 +26,27 @@ int main(int argc, char *argv[]) { exit(1); } - - if (strcmp(argv[1], "start") == 0) { - if ((fd = open("/var/ipfire/qos/enable", O_RDONLY)) != -1) - { - close(fd); - enable = 1; - } - - if (enable) - { - safe_system("/var/ipfire/qos/bin/qos.sh start"); - } - } else if (strcmp(argv[1], "stop") == 0) { - safe_system("/var/ipfire/qos/bin/qos.sh clear"); - } else if (strcmp(argv[1], "status") == 0) { - safe_system("/var/ipfire/qos/bin/qos.sh status"); - } else if (strcmp(argv[1], "restart") == 0) { - safe_system("/var/ipfire/qos/bin/qos.sh restart"); - } else { - fprintf(stderr, "\nBad argument given.\n\nqosctrl (start|stop|restart|status)\n\n"); - exit(1); + safe_system("chmod 755 /var/ipfire/qos/bin/qos.sh"); + if (strcmp(argv[1], "start") == 0) { + if ((fd = open("/var/ipfire/qos/bin/qos.sh", O_RDONLY)) != -1) + { + close(fd); + enable = 1; } + if (enable) + { + safe_system("/var/ipfire/qos/bin/qos.sh start"); + } + } else if (strcmp(argv[1], "stop") == 0) { + safe_system("/var/ipfire/qos/bin/qos.sh clear"); + } else if (strcmp(argv[1], "status") == 0) { + safe_system("/var/ipfire/qos/bin/qos.sh status"); + } else if (strcmp(argv[1], "restart") == 0) { + safe_system("/var/ipfire/qos/bin/qos.sh restart"); + } else { + fprintf(stderr, "\nBad argument given.\n\nqosctrl (start|stop|restart|status)\n\n"); + exit(1); + } return 0; }