usr/local/bin/openvpnctrl
usr/local/bin/qosctrl
usr/local/bin/rebuildhosts
+usr/local/bin/redctrl
usr/local/bin/restartapplejuice
usr/local/bin/restartdhcp
usr/local/bin/restartntpd
}
if ($cgiparams{'ACTION'} eq $Lang::tr{'dial'}) {
- system('/etc/rc.d/init.d/red','start') == 0
+ system('/usr/local/bin/redctrl','start') == 0
or &General::log("Dial failed: $?"); }
elsif ($cgiparams{'ACTION'} eq $Lang::tr{'hangup'}) {
- system('/etc/rc.d/init.d/red','stop') == 0
+ system('/usr/local/bin/redctrl','stop') == 0
or &General::log("Hangup failed: $?"); }
sleep 1;
setaliases ipfirebackup restartntpd \
restartapplejuice setdate rebuildhosts \
restartsyslogd logwatch openvpnctrl timecheckctrl \
- restartwireless getipstat qosctrl launch-ether-wake
+ restartwireless getipstat qosctrl launch-ether-wake \
+ redctrl
install : all
install -m 755 $(PROGS) /usr/local/bin
qosctrl: qosctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ qosctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+redctrl: redctrl.c setuid.o ../install+setup/libsmooth/varval.o
+ $(COMPILE) -I../install+setup/libsmooth/ redctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
launch-ether-wake: launch-ether-wake.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ launch-ether-wake.c setuid.o ../install+setup/libsmooth/varval.o -o $@
--- /dev/null
+/* This file is part of the IPFire Firewall.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence. See the file COPYING for details.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "setuid.h"
+
+int main(int argc, char *argv[]) {
+
+ if (!(initsetuid()))
+ exit(1);
+
+ if (argc < 2) {
+ fprintf(stderr, "\nNo argument given.\n\nredctrl (start|stop|restart|clear)\n\n");
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "start") == 0) {
+ safe_system("/etc/rc.d/init.d/red start");
+ } else if (strcmp(argv[1], "stop") == 0) {
+ safe_system("/etc/rc.d/init.d/red stop");
+ } else if (strcmp(argv[1], "restart") == 0) {
+ safe_system("/etc/rc.d/init.d/red stop");
+ safe_system("sleep 3");
+ safe_system("/etc/rc.d/init.d/red start");
+ } else if (strcmp(argv[1], "clear") == 0) {
+ safe_system("/etc/rc.d/init.d/red clear");
+ } else {
+ fprintf(stderr, "\nBad argument given.\n\nredctrl (start|stop|restart|clear)\n\n");
+ exit(1);
+ }
+
+ return 0;
+}