PPPoE Verbindungen sollten nun aus dem Webinterface aufegbaut werden

können.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@409 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2007-02-11 16:29:00 +00:00
parent ed84e8b81a
commit d95bfe986b
4 changed files with 50 additions and 3 deletions

View 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

View 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;

View 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 $@

42
src/misc-progs/redctrl.c Normal file
View File

@@ -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;
}