]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
PPPoE Verbindungen sollten nun aus dem Webinterface aufegbaut werden
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sun, 11 Feb 2007 16:29:00 +0000 (16:29 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sun, 11 Feb 2007 16:29:00 +0000 (16:29 +0000)
können.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@409 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

config/rootfiles/common/misc-progs
html/cgi-bin/dial.cgi
src/misc-progs/Makefile
src/misc-progs/redctrl.c [new file with mode: 0644]

index 65e1920a7c02b772c006bff99a035e1c2c579190..b5a0615306f2010770364e48fbf7fd1be5ece637 100644 (file)
@@ -12,6 +12,7 @@ usr/local/bin/logwatch
 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
index 8ca13846baed00e4e97b7148cf0f686c939b32bc..05b005b6c7762080480f37740fdb4421b552e460 100644 (file)
@@ -60,10 +60,10 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'dial profile'})
 }
 
 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;
 
index 28ea7cf58396006891665942ec09ccb32da00fb3..ef1f360938e4635fdcc21c381855506656185e0b 100644 (file)
@@ -10,7 +10,8 @@ SUID_PROGS = setdmzholes setportfw setfilters setxtaccess restartdhcp restartsno
        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
@@ -42,6 +43,9 @@ openvpnctrl: openvpnctrl.c setuid.o ../install+setup/libsmooth/varval.o
 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 $@
 
diff --git a/src/misc-progs/redctrl.c b/src/misc-progs/redctrl.c
new file mode 100644 (file)
index 0000000..4ef5f33
--- /dev/null
@@ -0,0 +1,42 @@
+/* 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;
+}