Added option for firewall adjustment on blue

Added the Asterisk GUI written by Peter
Changed the style of the graphs


git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1183 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2008-02-04 06:47:55 +00:00
parent b2f872eb61
commit 42dc0090e3
17 changed files with 479 additions and 12 deletions

View File

@@ -18,6 +18,8 @@
case "${1}" in
start)
boot_mesg "Starting Asterisk PBX..."
/sbin/modprobe zaptel
/sbin/modprobe ztdummy
loadproc /usr/sbin/asterisk
;;
@@ -40,11 +42,28 @@ case "${1}" in
;;
status)
statusproc /usr/sbin/asterisk
statusproc /usr/sbin/asterisk > /tmp/ast 2>&1
STAT=$(cat /tmp/ast)
/bin/rm -f /tmp/ast
echo $STAT
EX_Z=$(echo $STAT | grep "not" | wc -l)
exit $EX_Z
;;
remod)
case "${2}" in
sip)asterisk -rx "sip reload" >/dev/null 2>&1 ;;
iax)asterisk -rx "iax2 reload" >/dev/null 2>&1 ;;
ext)asterisk -rx "dialplan reload" >/dev/null 2>&1 ;;
*) echo "Usage: ${0} remod {sip|iax|ext}"; exit 1 ;;
esac
;;
test) touch /tmp/test$$
;;
*)
echo "Usage: ${0} {start|stop|reload|restart|status}"
echo "Usage: ${0} {start|stop|reload|restart|status|remod}"
exit 1
;;
esac

View File

@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <signal.h>
#include "setuid.h"
#include <errno.h>
FILE *fd = NULL;
char blue_dev[STRING_SIZE] = "";
@@ -26,11 +27,21 @@ char command[STRING_SIZE];
void exithandler(void)
{
struct keyvalue *kv = NULL;
char buffer[STRING_SIZE];
if(strlen(blue_dev))
{
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG_DROP", blue_dev);
if(findkey(kv, "DROPWIRELESSINPUT", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG --log-prefix 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG_DROP", blue_dev);
}
if(findkey(kv, "DROPWIRELESSFORWARD", buffer) && !strcmp(buffer,"on")){
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG --log-prefix 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessinput'", blue_dev);
safe_system(command);
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessforward'", blue_dev);
safe_system(command);
}
@@ -64,6 +75,13 @@ int main(void)
exit(1);
}
/* Read in the firewall values */
if (!readkeyvalues(kv, CONFIG_ROOT "/optionsfw/settings"))
{
fprintf(stderr, "Cannot read optionsfw settings\n");
exit(1);
}
/* Get the GREEN interface details */
if(!findkey(kv, "GREEN_DEV", green_dev))
{

BIN
src/scripts/asterisk Normal file

Binary file not shown.