From 900832fa06d33b37620b357946322a19ea8b04c2 Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Thu, 23 Aug 2007 10:58:00 +0000 Subject: [PATCH] Alle Restartskripte umbenannt in CTRL Skripte git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@812 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/common/misc-progs | 7 +- html/cgi-bin/backup.cgi | 2 +- html/cgi-bin/logs.cgi/config.dat | 2 +- html/cgi-bin/remote.cgi | 6 +- html/cgi-bin/wireless.cgi | 6 +- src/initscripts/init.d/network | 2 +- src/misc-progs/Makefile | 18 +- src/misc-progs/{restartssh.c => sshctrl.c} | 14 +- .../{restartsyslogd.c => syslogdctrl.c} | 0 .../{restartwireless.c => wirelessctrl.c} | 294 +++++++++--------- tools/finder.sh | 4 +- 11 files changed, 178 insertions(+), 177 deletions(-) rename src/misc-progs/{restartssh.c => sshctrl.c} (91%) rename src/misc-progs/{restartsyslogd.c => syslogdctrl.c} (100%) rename src/misc-progs/{restartwireless.c => wirelessctrl.c} (94%) diff --git a/config/rootfiles/common/misc-progs b/config/rootfiles/common/misc-progs index e9cb406606..87cef398cf 100644 --- a/config/rootfiles/common/misc-progs +++ b/config/rootfiles/common/misc-progs @@ -16,8 +16,6 @@ usr/local/bin/pakfire usr/local/bin/qosctrl usr/local/bin/rebuildhosts usr/local/bin/redctrl -usr/local/bin/restartssh -usr/local/bin/restartwireless #usr/local/bin/sambactrl usr/local/bin/setdmzholes usr/local/bin/setportfw @@ -25,7 +23,10 @@ usr/local/bin/setxtaccess usr/local/bin/smartctrl usr/local/bin/snortctrl usr/local/bin/squidctrl +usr/local/bin/sshctrls +usr/local/bin/syslogdctrl usr/local/bin/timectrl #usr/local/bin/tripwirectrl usr/local/bin/upnpctrl -usr/local/bin/restartsyslogd +usr/local/bin/wirelessctrl + diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi index 877e634588..cb865495d0 100644 --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -58,7 +58,7 @@ elsif ( $cgiparams{'ACTION'} eq "restore" ) print UPLOADFILE; } close UPLOADFILE; - system("/usr/local/bin/backupctrl restore"); + system("/usr/local/bin/backupctrl restore >/dev/null"); } &Header::showhttpheaders(); diff --git a/html/cgi-bin/logs.cgi/config.dat b/html/cgi-bin/logs.cgi/config.dat index 4ef89ef75e..651853b9fb 100644 --- a/html/cgi-bin/logs.cgi/config.dat +++ b/html/cgi-bin/logs.cgi/config.dat @@ -58,7 +58,7 @@ if ($logsettings{'ACTION'} eq $Lang::tr{'save'}) unless ($errormessage) { &General::writehash("${General::swroot}/logging/settings", \%logsettings); - system('/usr/local/bin/restartsyslogd') == 0 + system('/usr/local/bin/syslogdctrl') == 0 or $errormessage = "$Lang::tr{'bad return code'} " . $?/256; } diff --git a/html/cgi-bin/remote.cgi b/html/cgi-bin/remote.cgi index 3b5916d99d..c0d25532b6 100644 --- a/html/cgi-bin/remote.cgi +++ b/html/cgi-bin/remote.cgi @@ -64,15 +64,15 @@ if ( (($remotesettings{'ACTION'} eq $Lang::tr{'save'}) || ($remotesettings{'ACTI &General::log($Lang::tr{'ssh1 disabled'}); } if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ){ - system('/usr/local/bin/restartssh','tempstart15') == 0 + system('/usr/local/bin/sshctrl','tempstart15') == 0 or $errormessage = "$Lang::tr{'bad return code'} " . $?/256; } elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){ - system('/usr/local/bin/restartssh','tempstart30') == 0 + system('/usr/local/bin/sshctrl','tempstart30') == 0 or $errormessage = "$Lang::tr{'bad return code'} " . $?/256; } else { - system('/usr/local/bin/restartssh') == 0 + system('/usr/local/bin/sshctrl') == 0 or $errormessage = "$Lang::tr{'bad return code'} " . $?/256; } } diff --git a/html/cgi-bin/wireless.cgi b/html/cgi-bin/wireless.cgi index 3964835cdd..3a37b1512c 100644 --- a/html/cgi-bin/wireless.cgi +++ b/html/cgi-bin/wireless.cgi @@ -124,7 +124,7 @@ ADDERROR: close(FILE); undef %cgiparams; &General::log($Lang::tr{'wireless config added'}); - system('/usr/local/bin/restartwireless'); + system('/usr/local/bin/wirelessctrl'); } ADDEXIT: } @@ -148,7 +148,7 @@ if ($cgiparams{'ACTION'} eq 'edit') } } &General::log($Lang::tr{'wireless config changed'}); - system('/usr/local/bin/restartwireless'); + system('/usr/local/bin/wirelessctrl'); } if ($cgiparams{'ACTION'} eq 'remove' || $cgiparams{'ACTION'} eq 'toggle') @@ -169,7 +169,7 @@ if ($cgiparams{'ACTION'} eq 'remove' || $cgiparams{'ACTION'} eq 'toggle') } close(FILE); &General::log($Lang::tr{'wireless config changed'}); - system('/usr/local/bin/restartwireless'); + system('/usr/local/bin/wirelessctrl'); } diff --git a/src/initscripts/init.d/network b/src/initscripts/init.d/network index b2302e06a1..a6775027ed 100644 --- a/src/initscripts/init.d/network +++ b/src/initscripts/init.d/network @@ -42,7 +42,7 @@ init_networking() { if [ "$CONFIG_TYPE" = "3" -o "$CONFIG_TYPE" = "4" ]; then boot_mesg "Setting up wireless firewall rules" - /usr/local/bin/restartwireless; evaluate_retval + /usr/local/bin/wirelessctrl; evaluate_retval fi /etc/rc.d/init.d/dnsmasq start diff --git a/src/misc-progs/Makefile b/src/misc-progs/Makefile index 178099819c..27b472b35c 100644 --- a/src/misc-progs/Makefile +++ b/src/misc-progs/Makefile @@ -5,12 +5,12 @@ COMPILE=$(CC) $(CFLAGS) PROGS = iowrap SUID_PROGS = setdmzholes setportfw setxtaccess \ - squidctrl restartssh ipfirereboot \ + squidctrl sshctrl ipfirereboot \ ipsecctrl timectrl dhcpctrl snortctrl \ applejuicectrl rebuildhosts backupctrl \ logwatch openvpnctrl outgoingfwctrl \ - restartwireless getipstat qosctrl launch-ether-wake \ - redctrl restartsyslogd extrahdctrl sambactrl upnpctrl tripwirectrl \ + wirelessctrl getipstat qosctrl launch-ether-wake \ + redctrl syslogdctrl extrahdctrl sambactrl upnpctrl tripwirectrl \ smartctrl clamavctrl pakfire mpfirectrl install : all @@ -88,8 +88,8 @@ applejuicectrl: applejuicectrl.c setuid.o ../install+setup/libsmooth/varval.o dhcpctrl: dhcpctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ dhcpctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ -restartssh: restartssh.c setuid.o ../install+setup/libsmooth/varval.o - $(COMPILE) -I../install+setup/libsmooth/ restartssh.c setuid.o ../install+setup/libsmooth/varval.o -o $@ +sshctrl: sshctrl.c setuid.o ../install+setup/libsmooth/varval.o + $(COMPILE) -I../install+setup/libsmooth/ sshctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ squidctrl: squidctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ squidctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ @@ -97,8 +97,8 @@ squidctrl: squidctrl.c setuid.o ../install+setup/libsmooth/varval.o snortctrl: snortctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ snortctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ -restartwireless: restartwireless.c setuid.o ../install+setup/libsmooth/varval.o - $(COMPILE) -I../install+setup/libsmooth/ restartwireless.c setuid.o ../install+setup/libsmooth/varval.o -o $@ +wirelessctrl: wirelessctrl.c setuid.o ../install+setup/libsmooth/varval.o + $(COMPILE) -I../install+setup/libsmooth/ wirelessctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ ipsecctrl: ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ @@ -115,5 +115,5 @@ mpfirectrl: mpfirectrl.c setuid.o ../install+setup/libsmooth/varval.o backupctrl: backupctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ backupctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ -restartsyslogd: restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o - $(COMPILE) -I../install+setup/libsmooth/ restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o -o $@ +syslogdctrl: syslogdctrl.c setuid.o ../install+setup/libsmooth/varval.o + $(COMPILE) -I../install+setup/libsmooth/ syslogdctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ diff --git a/src/misc-progs/restartssh.c b/src/misc-progs/sshctrl.c similarity index 91% rename from src/misc-progs/restartssh.c rename to src/misc-progs/sshctrl.c index 40ef2159e0..b747421dea 100644 --- a/src/misc-progs/restartssh.c +++ b/src/misc-progs/sshctrl.c @@ -1,4 +1,4 @@ -/* SmoothWall helper program - restartssh +/* SmoothWall helper program - sshctrl * * This program is distributed under the terms of the GNU General Public * Licence. See the file COPYING for details. @@ -7,7 +7,7 @@ * Simple program intended to be installed setuid(0) that can be used for * restarting SSHd. * - * $Id: restartssh.c,v 1.3 2003/12/11 10:57:34 riddles Exp $ + * $Id: sshctrl.c,v 1.3 2003/12/11 10:57:34 riddles Exp $ * */ @@ -25,18 +25,18 @@ int main(int argc, char *argv[]) { if (strcmp(argv[1], "tempstart15") == 0) { - safe_system("/usr/local/bin/restartssh"); + safe_system("/usr/local/bin/sshctrl"); sleep(5); unlink("/var/ipfire/remote/enablessh"); safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings"); - safe_system("sleep 900 && /usr/local/bin/restartssh &"); + safe_system("sleep 900 && /usr/local/bin/sshctrl &"); } else if (strcmp(argv[1], "tempstart30") == 0) { - safe_system("/usr/local/bin/restartssh"); + safe_system("/usr/local/bin/sshctrl"); sleep(5); unlink("/var/ipfire/remote/enablessh"); safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings"); - safe_system("sleep 1800 && /usr/local/bin/restartssh &"); + safe_system("sleep 1800 && /usr/local/bin/sshctrl &"); } else { int fd, config_fd, rc, pid; char buffer[STRING_SIZE], command[STRING_SIZE] = "/bin/sed -e '"; @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) } /* By using O_CREAT with O_EXCL open() will fail if the file already exists, - * this prevents 2 copies of restartssh both trying to edit the config file + * this prevents 2 copies of sshctrl both trying to edit the config file * at once. It also prevents race conditions, but these shouldn't be * possible as /etc/ssh/ should only be writable by root anyhow */ diff --git a/src/misc-progs/restartsyslogd.c b/src/misc-progs/syslogdctrl.c similarity index 100% rename from src/misc-progs/restartsyslogd.c rename to src/misc-progs/syslogdctrl.c diff --git a/src/misc-progs/restartwireless.c b/src/misc-progs/wirelessctrl.c similarity index 94% rename from src/misc-progs/restartwireless.c rename to src/misc-progs/wirelessctrl.c index 79b519df44..51f3f254d2 100644 --- a/src/misc-progs/restartwireless.c +++ b/src/misc-progs/wirelessctrl.c @@ -1,147 +1,147 @@ -/* IPCop helper program - restartwireless - * - * This program is distributed under the terms of the GNU General Public - * Licence. See the file COPYING for details. - * - * (c) Alan Hourihane, 2003 - * - * $Id: restartwireless.c,v 1.2.2.5 2005/07/11 10:56:47 franck78 Exp $ - * - */ - -#include "libsmooth.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "setuid.h" - -FILE *fd = NULL; -char blue_dev[STRING_SIZE] = ""; -char command[STRING_SIZE]; - -void exithandler(void) -{ - if(strlen(blue_dev)) - { - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG_DROP", blue_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG_DROP", blue_dev); - safe_system(command); - } - - if (fd) - fclose(fd); -} - -int main(void) -{ - char green_dev[STRING_SIZE] = ""; - char buffer[STRING_SIZE]; - char *index, *ipaddress, *macaddress, *enabled; - struct keyvalue *kv = NULL; - - if (!(initsetuid())) - exit(1); - - /* flush wireless iptables */ - safe_system("/sbin/iptables -F WIRELESSINPUT > /dev/null 2> /dev/null"); - safe_system("/sbin/iptables -F WIRELESSFORWARD > /dev/null 2> /dev/null"); - - memset(buffer, 0, STRING_SIZE); - - /* Init the keyvalue structure */ - kv=initkeyvalues(); - - /* Read in the current values */ - if (!readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")) - { - fprintf(stderr, "Cannot read ethernet settings\n"); - exit(1); - } - - /* Get the GREEN interface details */ - if(!findkey(kv, "GREEN_DEV", green_dev)) - { - fprintf(stderr, "Cannot read GREEN_DEV\n"); - exit(1); - } - if (!VALID_DEVICE(green_dev)) - { - fprintf(stderr, "Bad GREEN_DEV: %s\n", green_dev); - exit(1); - } - /* Get the BLUE interface details */ - if(!findkey(kv, "BLUE_DEV", blue_dev)) - { - fprintf(stderr, "Cannot read BLUE_DEV\n"); - exit(1); - } - if (strlen(blue_dev) && !VALID_DEVICE(blue_dev)) - { - fprintf(stderr, "Bad BLUE_DEV: %s\n", blue_dev); - exit(1); - } - if(! strlen(blue_dev) > 0) - { - fprintf(stderr, "No BLUE interface\n"); - exit(0); - } - - /* register exit handler to ensure the block rule is always present */ - atexit(exithandler); - - if (!(fd = fopen(CONFIG_ROOT "/wireless/config", "r"))) - { - exit(0); - } - while (fgets(buffer, STRING_SIZE, fd)) - { - buffer[strlen(buffer) - 1] = 0; - - index = strtok(buffer, ","); - ipaddress = strtok(NULL, ","); - macaddress = strtok(NULL, ","); - enabled = strtok(NULL, ","); - - if (!strncmp(enabled, "on", 2)) { - - /* both specified, added security */ - if ((strlen(macaddress) == 17) && - (VALID_IP(ipaddress))) { - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j ACCEPT", macaddress, ipaddress, blue_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -o ! %s -j ACCEPT", macaddress, ipaddress, blue_dev, green_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -j DMZHOLES", macaddress, ipaddress, blue_dev); - safe_system(command); - } else { - - /* correctly formed mac address is 17 chars */ - if (strlen(macaddress) == 17) { - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -m mac --mac-source %s -i %s -j ACCEPT", macaddress, blue_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -i %s -o ! %s -j ACCEPT", macaddress, blue_dev, green_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -i %s -j DMZHOLES", macaddress, blue_dev); - safe_system(command); - } - - if (VALID_IP(ipaddress)) { - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -s %s -i %s -j ACCEPT", ipaddress, blue_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -s %s -i %s -o ! %s -j ACCEPT", ipaddress, blue_dev, green_dev); - safe_system(command); - snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -s %s -i %s -j DMZHOLES", ipaddress, blue_dev); - safe_system(command); - } - } - } - } - - return 0; -} +/* IPCop helper program - wirelessctrl + * + * This program is distributed under the terms of the GNU General Public + * Licence. See the file COPYING for details. + * + * (c) Alan Hourihane, 2003 + * + * $Id: wirelessctrl.c,v 1.2.2.5 2005/07/11 10:56:47 franck78 Exp $ + * + */ + +#include "libsmooth.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "setuid.h" + +FILE *fd = NULL; +char blue_dev[STRING_SIZE] = ""; +char command[STRING_SIZE]; + +void exithandler(void) +{ + if(strlen(blue_dev)) + { + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG_DROP", blue_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG_DROP", blue_dev); + safe_system(command); + } + + if (fd) + fclose(fd); +} + +int main(void) +{ + char green_dev[STRING_SIZE] = ""; + char buffer[STRING_SIZE]; + char *index, *ipaddress, *macaddress, *enabled; + struct keyvalue *kv = NULL; + + if (!(initsetuid())) + exit(1); + + /* flush wireless iptables */ + safe_system("/sbin/iptables -F WIRELESSINPUT > /dev/null 2> /dev/null"); + safe_system("/sbin/iptables -F WIRELESSFORWARD > /dev/null 2> /dev/null"); + + memset(buffer, 0, STRING_SIZE); + + /* Init the keyvalue structure */ + kv=initkeyvalues(); + + /* Read in the current values */ + if (!readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")) + { + fprintf(stderr, "Cannot read ethernet settings\n"); + exit(1); + } + + /* Get the GREEN interface details */ + if(!findkey(kv, "GREEN_DEV", green_dev)) + { + fprintf(stderr, "Cannot read GREEN_DEV\n"); + exit(1); + } + if (!VALID_DEVICE(green_dev)) + { + fprintf(stderr, "Bad GREEN_DEV: %s\n", green_dev); + exit(1); + } + /* Get the BLUE interface details */ + if(!findkey(kv, "BLUE_DEV", blue_dev)) + { + fprintf(stderr, "Cannot read BLUE_DEV\n"); + exit(1); + } + if (strlen(blue_dev) && !VALID_DEVICE(blue_dev)) + { + fprintf(stderr, "Bad BLUE_DEV: %s\n", blue_dev); + exit(1); + } + if(! strlen(blue_dev) > 0) + { + fprintf(stderr, "No BLUE interface\n"); + exit(0); + } + + /* register exit handler to ensure the block rule is always present */ + atexit(exithandler); + + if (!(fd = fopen(CONFIG_ROOT "/wireless/config", "r"))) + { + exit(0); + } + while (fgets(buffer, STRING_SIZE, fd)) + { + buffer[strlen(buffer) - 1] = 0; + + index = strtok(buffer, ","); + ipaddress = strtok(NULL, ","); + macaddress = strtok(NULL, ","); + enabled = strtok(NULL, ","); + + if (!strncmp(enabled, "on", 2)) { + + /* both specified, added security */ + if ((strlen(macaddress) == 17) && + (VALID_IP(ipaddress))) { + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j ACCEPT", macaddress, ipaddress, blue_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -o ! %s -j ACCEPT", macaddress, ipaddress, blue_dev, green_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -j DMZHOLES", macaddress, ipaddress, blue_dev); + safe_system(command); + } else { + + /* correctly formed mac address is 17 chars */ + if (strlen(macaddress) == 17) { + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -m mac --mac-source %s -i %s -j ACCEPT", macaddress, blue_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -i %s -o ! %s -j ACCEPT", macaddress, blue_dev, green_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -m mac --mac-source %s -i %s -j DMZHOLES", macaddress, blue_dev); + safe_system(command); + } + + if (VALID_IP(ipaddress)) { + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -s %s -i %s -j ACCEPT", ipaddress, blue_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -s %s -i %s -o ! %s -j ACCEPT", ipaddress, blue_dev, green_dev); + safe_system(command); + snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -s %s -i %s -j DMZHOLES", ipaddress, blue_dev); + safe_system(command); + } + } + } + } + + return 0; +} diff --git a/tools/finder.sh b/tools/finder.sh index 8022cb0a49..a88f0a7767 100644 --- a/tools/finder.sh +++ b/tools/finder.sh @@ -10,9 +10,9 @@ echo -n "Output to file? (y/n): " ;read jn if [ "$jn" = "y" ]; then echo "Creating log file $name" - find $wo -type f | xargs grep -in "$was" > $name + find $wo -type f | xargs grep -in "$was" 2>/dev/null | grep -v ".svn" | grep -v "ChangeLog" | grep -v "/serv/ipfire/branches/ipcop-1.4" | grep -v "/serv/ipfire/tags/beta0" > $name else - find $wo -type f | xargs grep -in "$was" + find $wo -type f | xargs grep -in "$was" 2>/dev/null | grep -v ".svn" | grep -v "ChangeLog" | grep -v "/serv/ipfire/branches/ipcop-1.4" | grep -v "/serv/ipfire/tags/beta0" fi if [ -d $name ]; then -- 2.39.2