Alle Restartskripte umbenannt in CTRL Skripte

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@812 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2007-08-23 10:58:00 +00:00
parent a1d042ddd6
commit 900832fa06
11 changed files with 178 additions and 177 deletions

View File

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

View File

@@ -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();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
*/

View File

@@ -1,11 +1,11 @@
/* IPCop helper program - restartwireless
/* 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: restartwireless.c,v 1.2.2.5 2005/07/11 10:56:47 franck78 Exp $
* $Id: wirelessctrl.c,v 1.2.2.5 2005/07/11 10:56:47 franck78 Exp $
*
*/

View File

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