Ended core 5 and started core 6

Fixed qosctrl
Fixed Squid init script
Cosmetic changes for the graphswq


git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1140 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2008-01-11 18:26:42 +00:00
parent 4414685ac5
commit af95dec53c
12 changed files with 52 additions and 41 deletions

View File

@@ -65,7 +65,7 @@ case "$1" in
stop)
if [ -e /var/ipfire/proxy/enable -o -e /var/ipfire/proxy/enable_blue ]; then
if [ -e /var/run/squid.pid ]; then
boot_mesg "Stopping Squid Proxy Server..."
iptables -t nat -F SQUID
squid -k shutdown >/dev/null 2>&1

View File

@@ -15,38 +15,41 @@
int main(int argc, char *argv[]) {
int fd = -1;
int fd = -1;
if (!(initsetuid()))
exit(1);
if (!(initsetuid()))
exit(1);
if (argc < 2) {
fprintf(stderr, "\nNo argument given.\n\nqosctrl (start|stop|restart|status|generate)\n\n");
exit(1);
}
if ((fd = open("/var/ipfire/qos/bin/qos.sh", O_RDONLY)) != -1) {
close(fd);
} else {
// If there is no qos.sh do nothing.
exit(0);
}
safe_system("chmod 755 /var/ipfire/qos/bin/qos.sh &>/dev/null");
if (strcmp(argv[1], "start") == 0) {
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 if (strcmp(argv[1], "generate") == 0) {
safe_system("/usr/bin/perl /var/ipfire/qos/bin/makeqosscripts.pl > /var/ipfire/qos/bin/qos.sh");
} else {
fprintf(stderr, "\nBad argument given.\n\nqosctrl (start|stop|restart|status|generate)\n\n");
exit(1);
}
if (argc < 2) {
fprintf(stderr, "\nNo argument given.\n\nqosctrl (start|stop|restart|status|generate)\n\n");
exit(1);
}
return 0;
if (strcmp(argv[1], "generate") == 0) {
safe_system("/usr/bin/perl /var/ipfire/qos/bin/makeqosscripts.pl > /var/ipfire/qos/bin/qos.sh");
}
if ((fd = open("/var/ipfire/qos/bin/qos.sh", O_RDONLY)) != -1) {
close(fd);
} else {
// If there is no qos.sh do nothing.
exit(0);
}
safe_system("chmod 755 /var/ipfire/qos/bin/qos.sh &>/dev/null");
if (strcmp(argv[1], "start") == 0) {
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 {
if (strcmp(argv[1], "generate") == 0) {exit(0);}
fprintf(stderr, "\nBad argument given.\n\nqosctrl (start|stop|restart|status|generate)\n\n");
exit(1);
}
return 0;
}