RRDs::graph ("$graphs/load-$period.png",
"--start", "-1$period", "-aPNG",
"-w 600", "-h 100", "-i", "-z", "-W www.ipfire.org", "-l 0", "-r", "--alt-y-grid",
- "-t Load Average",
+ "-t Load Average $Lang::tr{'graph per'} $Lang::tr{$period}",
"--color", "SHADEA".$color{"color19"},
"--color", "SHADEB".$color{"color19"},
"--color", "BACK".$color{"color21"},
"--color", "SHADEA".$color{"color19"},
"--color", "SHADEB".$color{"color19"},
"--color", "BACK".$color{"color21"},
- "-t $Lang::tr{'disk access per'} $Lang::tr{$period} $disk",
+ "-t $disk $Lang::tr{'disk access per'} $Lang::tr{$period}",
"DEF:read=$rrdlog/disk-$disk.rrd:readsect:AVERAGE",
"DEF:write=$rrdlog/disk-$disk.rrd:writesect:AVERAGE",
"DEF:standby=$rrdlog/hddshutdown-$disk.rrd:standby:AVERAGE",
"--color", "SHADEA".$color{"color19"},
"--color", "SHADEB".$color{"color19"},
"--color", "BACK".$color{"color21"},
- "-t $Lang::tr{'traffic on'} $interface ($Lang::tr{'graph per'} $Lang::tr{$period})",
+ "-t $Lang::tr{'traffic on'} $interface $Lang::tr{'graph per'} $Lang::tr{$period}",
"-v$Lang::tr{'bytes per second'}",
"DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
"DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
RRDs::graph ("$graphs/lq-$period.png",
"--start", "-1$period", "-aPNG", "-i", "-z", "-W www.ipfire.org",
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
- "-t $Lang::tr{'linkq'} ($Lang::tr{'graph per'} $Lang::tr{$period})",
+ "-t $Lang::tr{'linkq'} $Lang::tr{'graph per'} $Lang::tr{$period}",
"--lazy",
"--color", "SHADEA".$color{"color19"},
"--color", "SHADEB".$color{"color19"},
"--color", "SHADEA".$color{"color19"},
"--color", "SHADEB".$color{"color19"},
"--color", "BACK".$color{"color21"},
- "-t $Lang::tr{'harddisk temperature'} ($Lang::tr{'graph per'} $Lang::tr{$period})",
+ "-t $disk $Lang::tr{'harddisk temperature'} $Lang::tr{'graph per'} $Lang::tr{$period}",
"DEF:temperature=$rrdlog/hddtemp-$disk.rrd:temperature:AVERAGE",
"DEF:standby=$rrdlog/hddshutdown-$disk.rrd:standby:AVERAGE",
"CDEF:st=standby,INF,*",
int main(int argc, char *argv[]) {
- int fd = -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);
- }
-
- return 0;
+ int fd = -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 (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;
}