mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Korrektur MPFire CGI
Language nachgetragen Syslogctrl angepasst Tunerrd geloescht git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@814 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -67,7 +67,6 @@ usr/local/bin/setddns.pl
|
|||||||
usr/local/bin/setreservedports
|
usr/local/bin/setreservedports
|
||||||
usr/local/bin/settime
|
usr/local/bin/settime
|
||||||
usr/local/bin/timecheck
|
usr/local/bin/timecheck
|
||||||
usr/local/bin/tunerrd.pl
|
|
||||||
usr/local/bin/vpn-watch
|
usr/local/bin/vpn-watch
|
||||||
#usr/local/include
|
#usr/local/include
|
||||||
#usr/local/lib
|
#usr/local/lib
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
WARNING: translation string unused: psk
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
WARNING: translation string unused: psk
|
||||||
|
|||||||
@@ -231,9 +231,13 @@ foreach (@songdb){
|
|||||||
@year = sort keys %hash;
|
@year = sort keys %hash;
|
||||||
my %hash = map{ $_, 1 }@genre;
|
my %hash = map{ $_, 1 }@genre;
|
||||||
@genre = sort keys %hash;
|
@genre = sort keys %hash;
|
||||||
|
my $artistcount = $#artist+1;
|
||||||
|
my $albumcount = $#album+1;
|
||||||
|
my $yearcount = $#year+1;
|
||||||
|
my $genrecount = $#genre+1;
|
||||||
print "<table width='95%' cellspacing='0'>";
|
print "<table width='95%' cellspacing='0'>";
|
||||||
if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'}</b></td></tr>";}
|
if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'}</b></td></tr>";}
|
||||||
else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - $#artist</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - $#album</b></td></tr>";}
|
else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - ".$artistcount."</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - ".$albumcount."</b></td></tr>";}
|
||||||
print <<END
|
print <<END
|
||||||
<tr><td align='center'>
|
<tr><td align='center'>
|
||||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||||
@@ -261,7 +265,7 @@ print <<END
|
|||||||
END
|
END
|
||||||
;
|
;
|
||||||
if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'}</b></td></tr>";}
|
if ( $#songdb eq '-1' ) {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'}</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'}</b></td></tr>";}
|
||||||
else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'} - $#year</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'} - $#genre</b></td></tr>";}
|
else {print "<tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'year'} - ".$yearcount."</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'genre'} - ".$genrecount."</b></td></tr>";}
|
||||||
print <<END
|
print <<END
|
||||||
<tr><td align='center'>
|
<tr><td align='center'>
|
||||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||||
|
|||||||
@@ -998,6 +998,7 @@
|
|||||||
'proxy access graphs' => 'Diagramme zur Proxyauslastung',
|
'proxy access graphs' => 'Diagramme zur Proxyauslastung',
|
||||||
'proxy log viewer' => 'Ansicht Proxy-Log',
|
'proxy log viewer' => 'Ansicht Proxy-Log',
|
||||||
'proxy logs' => 'Proxy-Logdateien',
|
'proxy logs' => 'Proxy-Logdateien',
|
||||||
|
'psk' => 'PSK',
|
||||||
'pulse' => 'Puls',
|
'pulse' => 'Puls',
|
||||||
'pulse dial' => 'Pulswahl:',
|
'pulse dial' => 'Pulswahl:',
|
||||||
'qos graphs' => 'Qos Diagramme',
|
'qos graphs' => 'Qos Diagramme',
|
||||||
|
|||||||
@@ -998,6 +998,7 @@
|
|||||||
'proxy access graphs' => 'Proxy access graphs',
|
'proxy access graphs' => 'Proxy access graphs',
|
||||||
'proxy log viewer' => 'Proxy log viewer',
|
'proxy log viewer' => 'Proxy log viewer',
|
||||||
'proxy logs' => 'Proxy Logs',
|
'proxy logs' => 'Proxy Logs',
|
||||||
|
'psk' => 'PSK',
|
||||||
'pulse' => 'Pulse',
|
'pulse' => 'Pulse',
|
||||||
'pulse dial' => 'Pulse dial:',
|
'pulse dial' => 'Pulse dial:',
|
||||||
'qos graphs' => 'Qos Graphs',
|
'qos graphs' => 'Qos Graphs',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#define ERR_ANY 1
|
#define ERR_ANY 1
|
||||||
#define ERR_SETTINGS 2 /* error in settings file */
|
#define ERR_SETTINGS 2 /* error in settings file */
|
||||||
#define ERR_ETC 3 /* error with CONFIG_ROOT/etc permissions */
|
#define ERR_ETC 3 /* error with /etc permissions */
|
||||||
#define ERR_CONFIG 4 /* error updated sshd_config */
|
#define ERR_CONFIG 4 /* error updated sshd_config */
|
||||||
#define ERR_SYSLOG 5 /* error restarting syslogd */
|
#define ERR_SYSLOG 5 /* error restarting syslogd */
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ int main(void)
|
|||||||
/* Read in and verify config */
|
/* Read in and verify config */
|
||||||
kv=initkeyvalues();
|
kv=initkeyvalues();
|
||||||
|
|
||||||
if (!readkeyvalues(kv, CONFIG_ROOT "/logging/settings"))
|
if (!readkeyvalues(kv, "/logging/settings"))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Cannot read syslog settings\n");
|
fprintf(stderr, "Cannot read syslog settings\n");
|
||||||
exit(ERR_SETTINGS);
|
exit(ERR_SETTINGS);
|
||||||
@@ -78,55 +78,55 @@ int main(void)
|
|||||||
freekeyvalues(kv);
|
freekeyvalues(kv);
|
||||||
|
|
||||||
|
|
||||||
/* If anyone other than root can write to CONFIG_ROOT/etc this would be totally
|
/* If anyone other than root can write to /etc this would be totally
|
||||||
* insecure - same if anyone other than root owns CONFIG_ROOT/etc, as they could
|
* insecure - same if anyone other than root owns /etc, as they could
|
||||||
* change the file mode to give themselves or anyone else write access. */
|
* change the file mode to give themselves or anyone else write access. */
|
||||||
|
|
||||||
if(lstat(CONFIG_ROOT "/etc",&st))
|
if(lstat("/etc",&st))
|
||||||
{
|
{
|
||||||
perror("Unable to stat" CONFIG_ROOT "/etc");
|
perror("Unable to stat /etc");
|
||||||
exit(ERR_ETC);
|
exit(ERR_ETC);
|
||||||
}
|
}
|
||||||
if(!S_ISDIR(st.st_mode))
|
if(!S_ISDIR(st.st_mode))
|
||||||
{
|
{
|
||||||
fprintf(stderr,CONFIG_ROOT "/etc is not a directory?!\n");
|
fprintf(stderr, "/etc is not a directory?!\n");
|
||||||
exit(ERR_ETC);
|
exit(ERR_ETC);
|
||||||
}
|
}
|
||||||
if ( st.st_uid != 0 || st.st_mode & S_IWOTH ||
|
if ( st.st_uid != 0 || st.st_mode & S_IWOTH ||
|
||||||
((st.st_gid != 0) && (st.st_mode & S_IWGRP)) )
|
((st.st_gid != 0) && (st.st_mode & S_IWGRP)) )
|
||||||
{
|
{
|
||||||
fprintf(stderr,CONFIG_ROOT "/etc is owned/writable by non-root users\n");
|
fprintf(stderr, "/etc is owned/writable by non-root users\n");
|
||||||
exit(ERR_ETC);
|
exit(ERR_ETC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* O_CREAT with O_EXCL will make open() fail if the file already exists -
|
/* O_CREAT with O_EXCL will make open() fail if the file already exists -
|
||||||
* mostly to prevent 2 copies running at once */
|
* mostly to prevent 2 copies running at once */
|
||||||
if ((config_fd = open( CONFIG_ROOT "/etc/syslog.conf.new", O_WRONLY|O_CREAT|O_EXCL, 0644 )) == -1 )
|
if ((config_fd = open( "/etc/syslog.conf.new", O_WRONLY|O_CREAT|O_EXCL, 0644 )) == -1 )
|
||||||
{
|
{
|
||||||
perror("Unable to open new config file");
|
perror("Unable to open new config file");
|
||||||
exit(ERR_CONFIG);
|
exit(ERR_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(buffer,"on"))
|
if (!strcmp(buffer,"on"))
|
||||||
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' " CONFIG_ROOT "/etc/syslog.conf >&%d", hostname, config_fd );
|
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' /etc/syslog.conf >&%d", hostname, config_fd );
|
||||||
else
|
else
|
||||||
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' " CONFIG_ROOT "/etc/syslog.conf >&%d", config_fd );
|
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
|
||||||
|
|
||||||
snprintf(buffer, STRING_SIZE - 1, "&& /bin/sed -e 's/*.\/var\/log\/messages/%s \/var\/log\/messages/' " CONFIG_ROOT "/etc/syslog.conf >&%d", varmessages, config_fd );
|
snprintf(buffer, STRING_SIZE - 1, "&& /bin/sed -e 's/*.\/var\/log\/messages/%s \/var\/log\/messages/' /etc/syslog.conf >&%d", varmessages, config_fd );
|
||||||
|
|
||||||
/* if the return code isn't 0 failsafe */
|
/* if the return code isn't 0 failsafe */
|
||||||
if ((rc = unpriv_system(buffer,99,99)) != 0)
|
if ((rc = unpriv_system(buffer,99,99)) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "sed returned bad exit code: %d\n", rc);
|
fprintf(stderr, "sed returned bad exit code: %d\n", rc);
|
||||||
close(config_fd);
|
close(config_fd);
|
||||||
unlink(CONFIG_ROOT "/etc/syslog.conf.new");
|
unlink("/etc/syslog.conf.new");
|
||||||
exit(ERR_CONFIG);
|
exit(ERR_CONFIG);
|
||||||
}
|
}
|
||||||
close(config_fd);
|
close(config_fd);
|
||||||
if (rename(CONFIG_ROOT "/etc/syslog.conf.new", CONFIG_ROOT "/etc/syslog.conf") == -1)
|
if (rename("/etc/syslog.conf.new /etc/syslog.conf") == -1)
|
||||||
{
|
{
|
||||||
perror("Unable to replace old config file");
|
perror("Unable to replace old config file");
|
||||||
unlink(CONFIG_ROOT "/etc/syslog.conf.new");
|
unlink("/etc/syslog.conf.new");
|
||||||
exit(ERR_CONFIG);
|
exit(ERR_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use RRDs;
|
|
||||||
|
|
||||||
# Settings
|
|
||||||
my $rrdlog = "/var/log/rrd";
|
|
||||||
$ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
|
||||||
|
|
||||||
RRDs::tune ("$rrdlog/cpu.rrd",
|
|
||||||
"-h", "user:600",
|
|
||||||
"-h", "system:600",
|
|
||||||
"-h", "idle:600");
|
|
||||||
|
|
||||||
RRDs::tune ("$rrdlog/mem.rrd",
|
|
||||||
"-h", "memused:600",
|
|
||||||
"-h", "memfree:600",
|
|
||||||
"-h", "memshared:600",
|
|
||||||
"-h", "membuffers:600",
|
|
||||||
"-h", "memcache:600",
|
|
||||||
"-h", "swapused:600",
|
|
||||||
"-h", "swapfree:600");
|
|
||||||
|
|
||||||
RRDs::tune ("$rrdlog/disk.rrd",
|
|
||||||
"-h", "readsect:600",
|
|
||||||
"-h", "writesect:600");
|
|
||||||
|
|
||||||
RRDs::tune ("$rrdlog/RED.rrd",
|
|
||||||
"-h", "incoming:600",
|
|
||||||
"-h", "outgoing:600");
|
|
||||||
|
|
||||||
RRDs::tune ("$rrdlog/GREEN.rrd",
|
|
||||||
"-h", "incoming:600",
|
|
||||||
"-h", "outgoing:600");
|
|
||||||
# end of script
|
|
||||||
Reference in New Issue
Block a user