From bac7231b69d9847a51673bda2dde9956609b8ccd Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Sun, 15 Jul 2007 07:33:07 +0000 Subject: [PATCH] Control Skripe korrigiert Pakfire 2sprachig gemacht MPFire Gui erweitert Language Missings bereinigt git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@688 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/mpfire/mpfire.pl | 42 +++---- doc/language_issues.en | 28 +++++ doc/language_missings | 28 ----- html/cgi-bin/mpfire.cgi | 51 +++++--- html/cgi-bin/pakfire.cgi | 14 +-- html/cgi-bin/qosgraph.cgi | 237 ------------------------------------ html/cgi-bin/redirect.cgi | 139 --------------------- langs/de/cgi-bin/de.pl | 8 ++ langs/en/cgi-bin/en.pl | 36 ++++++ src/misc-progs/backupctrl.c | 4 +- src/misc-progs/mpfirectrl.c | 10 +- src/misc-progs/sambactrl.c | 44 +++---- 12 files changed, 157 insertions(+), 484 deletions(-) delete mode 100644 html/cgi-bin/qosgraph.cgi delete mode 100644 html/cgi-bin/redirect.cgi diff --git a/config/mpfire/mpfire.pl b/config/mpfire/mpfire.pl index a3bfb9d7fd..17006db3bb 100644 --- a/config/mpfire/mpfire.pl +++ b/config/mpfire/mpfire.pl @@ -35,13 +35,11 @@ if ($ARGV[0] eq 'getdb') { &getExistingSongs(); print %songs; } - -if ($ARGV[0] eq 'play') { +elsif ($ARGV[0] eq 'play') { if ($debug){print "Yes we are called and we will play $ARGV[1]\n";} system("/usr/bin/mpg123 -b 1024 --aggressive -q \"$ARGV[1]\" 2>/dev/null >/dev/null &"); } - -if ($ARGV[0] eq 'stop') { +elsif ($ARGV[0] eq 'stop') { my $PID = `ps -ef | grep mpg123 | grep playlist | head -1 | awk '{ print \$2 }'`; if ( $PID ne "" ){ if ($debug){print "Stopping $PID\n";} @@ -49,48 +47,45 @@ if ($ARGV[0] eq 'stop') { } else {&stopweb();} } - -if ($ARGV[0] eq 'volup') { +elsif ($ARGV[0] eq 'volup') { if ($debug){print "Increasing Volume\n";} system("/usr/bin/amixer set Master $ARGV[1]%+ 2>/dev/null >/dev/null"); } - -if ($ARGV[0] eq 'voldown') { +elsif ($ARGV[0] eq 'voldown') { if ($debug){print "Decreasing Volume\n";} system("/usr/bin/amixer set Master $ARGV[1]%- 2>/dev/null >/dev/null"); } - -if ($ARGV[0] eq 'playall') { +elsif ($ARGV[0] eq 'playall') { if ($debug){print "Playing everything\n";} system("/usr/bin/mpg123 -b 1024 --aggressive -Zq@ /var/ipfire/mpfire/playlist 2>/dev/null >/dev/null &"); } - -if ($ARGV[0] eq 'pause') { +elsif ($ARGV[0] eq 'pause') { my $PID = `ps -ef | grep mpg123 | grep playlist | head -1 | awk '{ print \$2 }'`; if ($debug){print "Pausing Process $PID\n";} system("kill -STOP $PID"); } - -if ($ARGV[0] eq 'resume') { +elsif ($ARGV[0] eq 'resume') { my $PID = `ps -ef | grep mpg123 | grep playlist | head -1 | awk '{ print \$2 }'`; if ($debug){print "Resuming Process $PID\n";} system("kill -CONT $PID"); } - -if ($ARGV[0] eq 'next') { +elsif ($ARGV[0] eq 'next') { if ($debug){print "Next Song\n";} my $PID = `ps -ef | grep mpg123 | grep playlist | head -1 | awk '{ print \$2 }'`; system("kill -SIGINT $PID"); } - -if ($ARGV[0] eq 'song') { - my $song = `lsof -nX \| grep mpg123 \| grep REG \| grep mem | grep mp3`; +elsif ($ARGV[0] eq 'song') { + my $song = `lsof -nX \| grep mpg123 \| grep REG \| grep mem | grep mp3 \| grep -v "sh -c"`; my @song = split(/\//,$song); my $i = @song; - print $song[$i-1]; + if ( $i == 0 ){ + my $song = `ps -ef \| grep wget \| grep EXTM3U \| grep -v "sh -c"`; + my @song = split(/\//,$song); + print $song[2]; } - -if ($ARGV[0] eq 'playweb') { + else { print $song[$i-1];} + } +elsif ($ARGV[0] eq 'playweb') { &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); if ($debug){print "Playing webstream\n";} if ($proxysettings{'UPSTREAM_PROXY'}) { @@ -102,8 +97,7 @@ if ($ARGV[0] eq 'playweb') { system("wget -qO - `wget -qO - $ARGV[1]` | mpg123 -b 1024 --aggressive -Zq - 2>/dev/null >/dev/null &"); } } - -if ($ARGV[0] eq 'stopweb') { +elsif ($ARGV[0] eq 'stopweb') { &stopweb(); } diff --git a/doc/language_issues.en b/doc/language_issues.en index 646c420402..5eb881c326 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -65,12 +65,15 @@ WARNING: translation string unused: backup key file WARNING: translation string unused: backup key info WARNING: translation string unused: backup media info WARNING: translation string unused: backup missing key +WARNING: translation string unused: backup password WARNING: translation string unused: backup protect key password WARNING: translation string unused: backup sets WARNING: translation string unused: backup to floppy +WARNING: translation string unused: bad characters in WARNING: translation string unused: bewan adsl pci st WARNING: translation string unused: bewan adsl usb WARNING: translation string unused: bleeding rules +WARNING: translation string unused: blue access use hint WARNING: translation string unused: blue interface WARNING: translation string unused: cache management WARNING: translation string unused: cache size @@ -86,6 +89,7 @@ WARNING: translation string unused: compression WARNING: translation string unused: connect WARNING: translation string unused: connect the modem WARNING: translation string unused: could not connect to +WARNING: translation string unused: could not connect to www ipcop org WARNING: translation string unused: could not connect to www ipfire org WARNING: translation string unused: could not create directory WARNING: translation string unused: could not download latest patch list @@ -94,6 +98,7 @@ WARNING: translation string unused: could not open available updates file WARNING: translation string unused: could not open installed updates file WARNING: translation string unused: could not open update information file WARNING: translation string unused: create +WARNING: translation string unused: create new backup WARNING: translation string unused: current dynamic leases WARNING: translation string unused: current media WARNING: translation string unused: current ovpn @@ -101,7 +106,14 @@ WARNING: translation string unused: current profile WARNING: translation string unused: daily firewallhits WARNING: translation string unused: dat without key WARNING: translation string unused: dbfile +WARNING: translation string unused: ddns help dnsmadeeasy +WARNING: translation string unused: ddns help freedns +WARNING: translation string unused: ddns help plus WARNING: translation string unused: debugme +WARNING: translation string unused: dhcp base ip fixed lease +WARNING: translation string unused: dhcp create fixed leases +WARNING: translation string unused: dhcp fixed lease err1 +WARNING: translation string unused: dhcp fixed lease help1 WARNING: translation string unused: dhcp server disabled on blue interface WARNING: translation string unused: dhcp server enabled on blue interface WARNING: translation string unused: dial user password @@ -109,6 +121,7 @@ WARNING: translation string unused: dial user password has been changed WARNING: translation string unused: dialup settings WARNING: translation string unused: disconnect WARNING: translation string unused: display traffic at home +WARNING: translation string unused: dns server WARNING: translation string unused: do not log this port list WARNING: translation string unused: done WARNING: translation string unused: downlink speed @@ -122,6 +135,7 @@ WARNING: translation string unused: enabled on WARNING: translation string unused: enabledtitle WARNING: translation string unused: encrypted WARNING: translation string unused: err bk 1 +WARNING: translation string unused: err bk 10 password WARNING: translation string unused: err bk 2 key WARNING: translation string unused: err bk 3 tar WARNING: translation string unused: err bk 4 gz @@ -243,6 +257,7 @@ WARNING: translation string unused: openvpn server WARNING: translation string unused: optional data WARNING: translation string unused: optionsfw portlist hint WARNING: translation string unused: optionsfw warning +WARNING: translation string unused: or WARNING: translation string unused: original WARNING: translation string unused: other countries WARNING: translation string unused: ovpn @@ -267,10 +282,13 @@ WARNING: translation string unused: ovpnstatus log WARNING: translation string unused: ovpnsys log WARNING: translation string unused: package failed to install WARNING: translation string unused: password contains illegal characters +WARNING: translation string unused: password crypting key WARNING: translation string unused: passwords must be at least 6 characters in length WARNING: translation string unused: polfile WARNING: translation string unused: pots WARNING: translation string unused: profiles +WARNING: translation string unused: proxy no proxy extend +WARNING: translation string unused: proxy no proxy local WARNING: translation string unused: proxy port WARNING: translation string unused: psk WARNING: translation string unused: quick control @@ -278,13 +296,17 @@ WARNING: translation string unused: reboot schedule WARNING: translation string unused: rebooting WARNING: translation string unused: refresh update list WARNING: translation string unused: released +WARNING: translation string unused: removable device advice WARNING: translation string unused: reportfile WARNING: translation string unused: requested data WARNING: translation string unused: restore hardware settings WARNING: translation string unused: root +WARNING: translation string unused: root path WARNING: translation string unused: root user password WARNING: translation string unused: route subnet is invalid +WARNING: translation string unused: safe removal of umounted device WARNING: translation string unused: save error +WARNING: translation string unused: select media WARNING: translation string unused: send email notification WARNING: translation string unused: send test mail WARNING: translation string unused: server reserved @@ -299,6 +321,8 @@ WARNING: translation string unused: sitekeyfile WARNING: translation string unused: smbreload WARNING: translation string unused: squid extension methods WARNING: translation string unused: squid extension methods invalid +WARNING: translation string unused: squid fix cache +WARNING: translation string unused: ssh access tip WARNING: translation string unused: ssnetwork status WARNING: translation string unused: sspasswords WARNING: translation string unused: sssystem status @@ -325,6 +349,7 @@ WARNING: translation string unused: time date manually reset WARNING: translation string unused: to email adr WARNING: translation string unused: to install an update WARNING: translation string unused: to warn email bad +WARNING: translation string unused: too long 80 char max WARNING: translation string unused: traffic back WARNING: translation string unused: traffic calc time WARNING: translation string unused: traffic calc time bad @@ -335,6 +360,8 @@ WARNING: translation string unused: traffic shaping settings WARNING: translation string unused: traffic warn level bad WARNING: translation string unused: transfer limits WARNING: translation string unused: transparent on +WARNING: translation string unused: umount +WARNING: translation string unused: umount removable media before to unplug WARNING: translation string unused: unencrypted WARNING: translation string unused: update transcript WARNING: translation string unused: updates @@ -364,4 +391,5 @@ WARNING: translation string unused: warn when traffic reaches WARNING: translation string unused: web proxy configuration WARNING: translation string unused: week WARNING: translation string unused: weekly firewallhits +WARNING: translation string unused: xtaccess bad transfert WARNING: translation string unused: yearly firewallhits diff --git a/doc/language_missings b/doc/language_missings index 8f98f6dee3..6e12172da6 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -4,31 +4,3 @@ ############################################################################ # Checking cgi-bin translations for language: en # ############################################################################ -< backup password -< bad characters in -< blue access use hint -< could not connect to www ipcop org -< create new backup -< ddns help dnsmadeeasy -< ddns help freedns -< ddns help plus -< dhcp base ip fixed lease -< dhcp create fixed leases -< dhcp fixed lease err1 -< dhcp fixed lease help1 -< dns server -< err bk 10 password -< or -< password crypting key -< proxy no proxy extend -< proxy no proxy local -< removable device advice -< root path -< safe removal of umounted device -< select media -< squid fix cache -< ssh access tip -< too long 80 char max -< umount -< umount removable media before to unplug -< xtaccess bad transfert diff --git a/html/cgi-bin/mpfire.cgi b/html/cgi-bin/mpfire.cgi index 6b6b4acb5e..c294b63692 100644 --- a/html/cgi-bin/mpfire.cgi +++ b/html/cgi-bin/mpfire.cgi @@ -32,10 +32,10 @@ close(DATEI); &Header::showhttpheaders(); -sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} +sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} &Header::getcgihash(\%mpfiresettings); -&Header::openpage($Lang::tr{'mpfire'}, 1, ""); +&Header::openpage($Lang::tr{'mpfire'}, 1, ""); &Header::openbigbox('100%', 'left', '', $errormessage); ############################################################################################################################ @@ -48,20 +48,19 @@ delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresett system("/usr/local/bin/mpfirectrl scan $mpfiresettings{'SCANDIR'} $mpfiresettings{'SCANDIRDEPS'}"); refreshpage(); } - -if ( $mpfiresettings{'ACTION'} eq ">" ){system("/usr/local/bin/mpfirectrl","play","\"$mpfiresettings{'FILE'}\"");} -if ( $mpfiresettings{'ACTION'} eq "x" ){system("/usr/local/bin/mpfirectrl stop");} -if ( $mpfiresettings{'ACTION'} eq "||" ){system("/usr/local/bin/mpfirectrl pause");} -if ( $mpfiresettings{'ACTION'} eq "|>" ){system("/usr/local/bin/mpfirectrl resume");} -if ( $mpfiresettings{'ACTION'} eq ">>" ){system("/usr/local/bin/mpfirectrl next");} -if ( $mpfiresettings{'ACTION'} eq "stopweb" ){system("/usr/local/bin/mpfirectrl stopweb");} -if ( $mpfiresettings{'ACTION'} eq "playweb" ){system("/usr/local/bin/mpfirectrl","playweb","\"$mpfiresettings{'FILE'}\"");} -if ( $mpfiresettings{'ACTION'} eq "+" ){system("/usr/local/bin/mpfirectrl volup 5");} -if ( $mpfiresettings{'ACTION'} eq "-" ){system("/usr/local/bin/mpfirectrl voldown 5");} -if ( $mpfiresettings{'ACTION'} eq "++" ){system("/usr/local/bin/mpfirectrl volup 10");} -if ( $mpfiresettings{'ACTION'} eq "--" ){system("/usr/local/bin/mpfirectrl voldown 10");} -if ( $mpfiresettings{'ACTION'} eq "playlist" ){system("/usr/local/bin/mpfirectrl playall");} -if ( $mpfiresettings{'ACTION'} eq "playalbum" ) +elsif ( $mpfiresettings{'ACTION'} eq ">" ){system("/usr/local/bin/mpfirectrl","play","\"$mpfiresettings{'FILE'}\"");} +elsif ( $mpfiresettings{'ACTION'} eq "x" ){system("/usr/local/bin/mpfirectrl stop");} +elsif ( $mpfiresettings{'ACTION'} eq "||" ){system("/usr/local/bin/mpfirectrl pause");} +elsif ( $mpfiresettings{'ACTION'} eq "|>" ){system("/usr/local/bin/mpfirectrl resume");} +elsif ( $mpfiresettings{'ACTION'} eq ">>" ){system("/usr/local/bin/mpfirectrl next");} +elsif ( $mpfiresettings{'ACTION'} eq "stopweb" ){system("/usr/local/bin/mpfirectrl stopweb");} +elsif ( $mpfiresettings{'ACTION'} eq "playweb" ){system("/usr/local/bin/mpfirectrl","playweb","\"$mpfiresettings{'FILE'}\"");} +elsif ( $mpfiresettings{'ACTION'} eq "+" ){system("/usr/local/bin/mpfirectrl volup 5");} +elsif ( $mpfiresettings{'ACTION'} eq "-" ){system("/usr/local/bin/mpfirectrl voldown 5");} +elsif ( $mpfiresettings{'ACTION'} eq "++" ){system("/usr/local/bin/mpfirectrl volup 10");} +elsif ( $mpfiresettings{'ACTION'} eq "--" ){system("/usr/local/bin/mpfirectrl voldown 10");} +elsif ( $mpfiresettings{'ACTION'} eq "playlist" ){system("/usr/local/bin/mpfirectrl playall");} +elsif ( $mpfiresettings{'ACTION'} eq "playalbum" ) { my @temp = ""; my @album = split(/\|/,$mpfiresettings{'album'}); @@ -77,7 +76,7 @@ print DATEI @temp; close(DATEI); system("/usr/local/bin/mpfirectrl playall"); } -if ( $mpfiresettings{'ACTION'} eq "playartist" ) +elsif ( $mpfiresettings{'ACTION'} eq "playartist" ) { my @temp = ""; my @artist = split(/\|/,$mpfiresettings{'artist'}); @@ -93,7 +92,7 @@ print DATEI @temp; close(DATEI); system("/usr/local/bin/mpfirectrl playall"); } -if ( $mpfiresettings{'ACTION'} eq "playall" ) +elsif ( $mpfiresettings{'ACTION'} eq "playall" ) { my @temp = ""; foreach (@songdb){ @@ -106,7 +105,7 @@ print DATEI @temp; close(DATEI); system("/usr/local/bin/mpfirectrl playall"); } -if ( $mpfiresettings{'SHOWLIST'} ){delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};&General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);} +elsif ( $mpfiresettings{'SHOWLIST'} ){delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};&General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);} ############################################################################################################################ ################################### Aufbau der HTML Seite fr globale Sambaeinstellungen #################################### @@ -260,10 +259,22 @@ open(DATEI, "<${General::swroot}/mpfire/playlist") || die "Could not open playli my @playlist = ; close(DATEI); +my %hash; +foreach (@songdb){ + my @song = split(/\|/,$_); + chomp($song[0]); + $hash{$song[0]}=$song[1]." - ".$song[2]." - ".$song[7].":".$song[8]; +} + print < $Lang::tr{'current playlist'} -
+
diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index c9d9db8ba0..464d8d8c18 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -47,7 +47,7 @@ if ($pakfiresettings{'ACTION'} eq 'install'){ &Header::openbox("100%", "center", "Abfrage"); my @output = `/usr/local/bin/pakfire resolvedeps $pakfiresettings{'INSPAKS'}`; print <Sie maechten folgende Pakete installieren: "$pakfiresettings{'INSPAKS'}". Moeglicherweise haben diese Pakete Abhaengigkeiten, d.h. andere Pakete muessen zusaetzlich installiert werden. Dazu sehen sie unten eine Liste. + -
$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'}
		
 END
 		foreach (@output) {
@@ -55,7 +55,7 @@ END
 		}
 		print <
-		
Moechten Sie der Installation aller Pakete zustimmen? +
$Lang::tr{'pakfire accept all'}
 
@@ -119,7 +119,7 @@ if ($return) {
$Lang::tr{  - Pakfire fuehrt gerade eine Aufgabe aus... Bitte warten sie, bis diese erfolgreich beendet wurde. + $Lang::tr{'pakfire working'}
@@ -171,7 +171,7 @@ print < Installierte Addons:
+
$Lang::tr{'pakfire installed addons'}
-
Zur Verfuegung stehende Updates: +
$Lang::tr{'pakfire updates'}
  -
Automatische Updates taeglich ausfuehren: +
$Lang::tr{'pakfire update daily'} - Registrierung am Master-Server: + $Lang::tr{'pakfire register'}
diff --git a/html/cgi-bin/qosgraph.cgi b/html/cgi-bin/qosgraph.cgi deleted file mode 100644 index 9a850146a0..0000000000 --- a/html/cgi-bin/qosgraph.cgi +++ /dev/null @@ -1,237 +0,0 @@ -#!/usr/bin/perl -# -# SmoothWall CGIs -# -# This code is distributed under the terms of the GPL -# -# (c) The SmoothWall Team -# -# - -use strict; - -# enable only the following on debugging purpose -use warnings; -use CGI::Carp 'fatalsToBrowser'; - -require '/var/ipfire/general-functions.pl'; -require "${General::swroot}/lang.pl"; -require "${General::swroot}/header.pl"; -require "${General::swroot}/graphs.pl"; - -#workaround to suppress a warning when a variable is used only once -my @dummy = ( ${Header::colourred} ); -undef (@dummy); - -my %qossettings = (); -my %checked = (); -my %netsettings = (); -my $message = ''; -my $errormessage = ""; -my $c = ""; -my $direntry = ""; -my $classentry = ""; -my $subclassentry = ""; -my $l7ruleentry = ""; -my $portruleentry = ""; -my $tosruleentry = ""; -my @tmp = (); -my @classes = (); -my @subclasses = (); -my @l7rules = (); -my @portrules = (); -my @tosrules = (); -my @tmpline = (); -my @classline = (); -my @subclassline = (); -my @l7ruleline = (); -my @portruleline = (); -my @tosruleline = (); -my @proto = (); -my %selected= (); -my @checked = (); -my $classfile = "/var/ipfire/qos/classes"; -my $subclassfile = "/var/ipfire/qos/subclasses"; -my $level7file = "/var/ipfire/qos/level7config"; -my $portfile = "/var/ipfire/qos/portconfig"; -my $tosfile = "/var/ipfire/qos/tosconfig"; -&General::readhash("${General::swroot}/ethernet/settings", \%netsettings); - -&overviewgraph($qossettings{'RED_DEV'}); -&overviewgraph($qossettings{'IMQ_DEV'}); - -my %color = (); -my %mainsettings = (); -&General::readhash("${General::swroot}/main/settings", \%mainsettings); -&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); - -my %cgiparams=(); -# Maps a nice printable name to the changing part of the pid file, which -# is also the name of the program - - -# Generate Graphs from rrd Data -&Graphs::updatecpugraph ("day"); -&Graphs::updateloadgraph ("day"); - -&Header::showhttpheaders(); -&Header::getcgihash(\%cgiparams); -&Header::openpage($Lang::tr{'status information'}, 1, ''); -&Header::openbigbox('100%', 'left'); - - open( FILE, "< $classfile" ) or die "Unable to read $classfile"; - @classes = ; - close FILE; - open( FILE, "< $subclassfile" ) or die "Unable to read $subclassfile"; - @subclasses = ; - close FILE; - &Header::openbox('100%', 'left', 'QoS Graphen'); - print <
Diese Seite braucht je nach Geschwindigkeit des Computers laenger zum Laden. -
Klasse: -END -; - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - $qossettings{'CLASS'}=$classline[1]; - print < -END -; - } - print < -END -; - &Header::closebox(); - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - $qossettings{'DEV'}=$classline[0]; - $qossettings{'CLASS'}=$classline[1]; - &gengraph($qossettings{'DEV'},$qossettings{'CLASS'}); - print "
-
-
-END -; - foreach $subclassentry (sort @subclasses) - { - @subclassline = split( /\;/, $subclassentry ); - if ($subclassline[1] eq $classline[1]) { - $qossettings{'DEV'}=$subclassline[0]; - $qossettings{'SCLASS'}=$subclassline[2]; - &gengraph($qossettings{'DEV'},$qossettings{'SCLASS'}); - print < -
-
-END -; - } - } - print "\t\t
"; - &Header::closebox(); - print "\n"; - } -print < -END -; - -if (( -e "/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'RED_DEV'}.png") && ( -e "/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'IMQ_DEV'}.png")) { - print <
-
-END -;} - - -&Header::closebox(); -&Header::closebigbox(); -&Header::closepage(); - -sub gengraph { - $qossettings{'DEV'} = shift; - $qossettings{'CLASS'} = shift; - my $ERROR=""; - if ( $qossettings{'DEV'} eq $qossettings{'RED_DEV'} ) { - $qossettings{'CLASSPRFX'} = '1'; - } else { - $qossettings{'CLASSPRFX'} = '2'; - } - my $color=random_hex_color(6); - - RRDs::graph ("/srv/web/ipfire/html/graphs/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}-packets.png", - "--start", "-3240", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 600", "-h 150", "-r", - "--color", "SHADEA#EAE9EE", - "--color", "SHADEB#EAE9EE", - "--color", "BACK#FFFFFF", - "-t $qossettings{'CLASS'} ($qossettings{'DEV'})", - "DEF:pkts=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:pkts:AVERAGE", - "DEF:dropped=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:dropped:AVERAGE", - "DEF:overlimits=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$qossettings{'CLASS'}_$qossettings{'DEV'}.rrd:overlimits:AVERAGE", - "AREA:pkts$color:packets", - "GPRINT:pkts:LAST:total packets\\:%8.3lf %s packets\\j", - "LINE3:dropped#FF0000:dropped", - "GPRINT:dropped:LAST:dropped packets\\:%8.3lf %s packets\\j", - "LINE3:overlimits#0000FF:overlimits", - "GPRINT:overlimits:LAST:overlimits\\:%8.3lf %s packets\\j", - ); -} - - -sub overviewgraph { - $qossettings{'DEV'} = shift; - if ( $qossettings{'DEV'} eq $qossettings{'RED_DEV'} ) { - $qossettings{'CLASSPRFX'} = '1'; - } else { - $qossettings{'CLASSPRFX'} = '2'; - } - my $ERROR=""; - my $count="1"; - my $color="#000000"; - my @command=("/srv/web/ipfire/html/graphs/qos-graph-$qossettings{'DEV'}.png", - "--start", "-3240", "-aPNG", "-i", "-z", - "--alt-y-grid", "-w 600", "-h 150", "-r", - "--color", "SHADEA#EAE9EE", - "--color", "SHADEB#EAE9EE", - "--color", "BACK#FFFFFF", - "-t Auslastung auf ($qossettings{'DEV'})" - ); - open( FILE, "< $classfile" ) or die "Unable to read $classfile"; - @classes = ; - close FILE; - foreach $classentry (sort @classes) - { - @classline = split( /\;/, $classentry ); - if ( $classline[0] eq $qossettings{'DEV'} ) - { - $color=random_hex_color(6); - push(@command, "DEF:$classline[1]=/var/log/rrd/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bits:AVERAGE"); - - if ($count eq "1") { - push(@command, "AREA:$classline[1]$color:Klasse $classline[1] - $classline[8]\\j"); - } else { - push(@command, "STACK:$classline[1]$color:Klasse $classline[1] - $classline[8]\\j"); - } - $count++; - } - } - RRDs::graph (@command); -} - -sub random_hex_color { - my $size = shift; - $size = 6 if $size !~ /^3|6$/; - my @hex = ( 0 .. 9, 'a' .. 'f' ); - my @color; - push @color, @hex[rand(@hex)] for 1 .. $size; - return join('', '#', @color); -} diff --git a/html/cgi-bin/redirect.cgi b/html/cgi-bin/redirect.cgi deleted file mode 100644 index 37ee307443..0000000000 --- a/html/cgi-bin/redirect.cgi +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl - -# -# redirect.cgi - By IPFire-Team (C) -# - -use CGI qw(param); - -$swroot="/var/ipfire"; - -my %netsettings; -my %filtersettings; - -&readhash("$swroot/ethernet/settings", \%netsettings); -&readhash("$swroot/urlfilter/settings", \%filtersettings); - -$category=param("category"); -$url=param("url"); -$ip=param("ip"); - -if ($filtersettings{'MSG_TEXT_1'} eq '') { - $msgtext1 = "A C C E S S    D E N I E D"; -} else { $msgtext1 = $filtersettings{'MSG_TEXT_1'}; } -if ($filtersettings{'MSG_TEXT_2'} eq '') { - $msgtext2 = "Access to the requested page has been denied"; -} else { $msgtext2 = $filtersettings{'MSG_TEXT_2'}; } -if ($filtersettings{'MSG_TEXT_3'} eq '') { - $msgtext3 = "Please contact the Network Administrator if you think there has been an error"; -} else { $msgtext3 = $filtersettings{'MSG_TEXT_3'}; } - -if ($category eq '') { $category = ' '; } else { $category = '['.$category.']'; } - -print "Pragma: no-cache\n"; -print "Cache-control: no-cache\n"; -print "Connection: close\n"; -print "Content-type: text/html\n\n"; - -print < - - - -ACCESS MESSAGE - - - - - - -
-
- $msgtext1 - - -END -; - -if (!($category eq "")) -{ - print < - - $category - -END -; -} -print < - - - $msgtext2 - - -END -; - -if (!($url eq "")) -{ -print <URL: $url -END -; -} - -if (!($ip eq "")) -{ -print <Client IP address: $ip -END -; -} - -print <

$msgtext3 - - -

- Web Filtering by - - - IPFire - - -
- - - -END -; - -sub readhash -{ - my $filename = $_[0]; - my $hash = $_[1]; - my ($var, $val); - - if (-e $filename) - { - open(FILE, $filename) or die "Unable to read file $filename"; - while () - { - chop; - ($var, $val) = split /=/, $_, 2; - if ($var) - { - $val =~ s/^\'//g; - $val =~ s/\'$//g; - - # Untaint variables read from hash - $var =~ /([A-Za-z0-9_-]*)/; $var = $1; - $val =~ /([\w\W]*)/; $val = $1; - $hash->{$var} = $val; - } - } - close FILE; - } -} diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 26db4e4785..b264117e1e 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1168,7 +1168,15 @@ 'ovpnsys log' => 'OVPN-System-Log', 'package failed to install' => 'Programmpaket konnte nicht installiert werden.', 'pagerefresh' => 'Seite wird aktualisiert. Bitte warten.', +'pakfire accept all' => 'Möchten Sie der Installation aller Pakete zustimmen?', 'pakfire configuration' => 'Pakfire Konfiguration', +'pakfire install package' => 'Sie möchten folgende Pakete installieren: ', +'pakfire installed addons' => 'Installierte Addons:', +'pakfire possible dependency' => ' Möglicherweise haben diese Pakete Abhängigkeiten, d.h. andere Pakete müssen zusätzlich installiert werden. Dazu sehen sie unten eine Liste.', +'pakfire register' => 'Registrierung am Master-Server:', +'pakfire update daily' => 'Automatische Updates täglich ausführen:', +'pakfire updates' => 'Zur Verfügung stehende Updates:', +'pakfire working' => 'Pakfire führt gerade eine Aufgabe aus... Bitte warten sie, bis diese erfolgreich beendet wurde.', 'pap or chap' => 'PAP oder CHAP', 'password' => 'Passwort:', 'password contains illegal characters' => 'Passwort enthält ungültige(s) Zeichen.', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 5a52ed3178..077d67db92 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -349,11 +349,13 @@ 'backup key info' => 'IPFire restricts access to the backup key, thus you must know root password. You have possibility to protect this key outside of IPFire with a password.', 'backup media info' => 'Floppy and/or unformatted media may display stranges partitions sizes. In this case, select the whole device. Remenber to mount harddisk before removing device. Note: floppy created here are not usable with IPFire installer program!', 'backup missing key' => 'Need the backup key to restore a set', +'backup password' => 'Backup password', 'backup protect key password' => 'Backup key password', 'backup sets' => 'Backup Sets', 'backup to floppy' => 'Backup to floppy', 'backupprofile' => 'In case reconnection fails, switch to profile', 'backups' => 'backups', +'bad characters in' => 'Bad characters in ', 'bad characters in script field' => 'Bad characters in script field', 'bad characters in the telephone number field' => 'Bad characters in the telephone number field.', 'bad destination range' => 'The Destination port range has a first value that is greater than or equal to the second value.', @@ -370,6 +372,7 @@ 'bleeding rules' => 'Bleeding Edge Snort Rules', 'blue' => 'BLUE', 'blue access' => 'Blue Access', +'blue access use hint' => 'You have to enter the MAC or the IP Adress for a device. To enter both is also possible', 'blue interface' => 'Blue Interface', 'broadcast' => 'Broadcast', 'broken pipe' => 'Broken pipe', @@ -479,6 +482,7 @@ 'connscheduler' => 'Connection Scheduler', 'could not be opened' => 'could not be opened', 'could not connect to' => 'Could not connect to', +'could not connect to www ipcop org' => 'Could not connect to www.ipcop.org', 'could not connect to www ipfire org' => 'Could not connect to www.ipfire.org', 'could not create directory' => 'Could not create directory.', 'could not download latest patch list' => 'Could not download latest patch list (not connected).', @@ -493,6 +497,7 @@ 'cpu usage per' => 'CPU Usage per', 'create' => 'Create', 'create mask' => 'UNIX rights for new created files', +'create new backup' => 'Create a new backup set', 'credits' => 'Credits', 'crl' => 'Certificate Revocation List', 'cron server' => 'CRON server', @@ -519,6 +524,9 @@ 'day before' => 'Day before', 'days' => 'days', 'dbfile' => 'Dbfile', +'ddns help dnsmadeeasy' => 'In the field for hostname enter your ID (or a list of IDs seperated by;)', +'ddns help freedns' => 'In the fied Username enter your Connect String', +'ddns help plus' => '+ marks a mandatory field', 'ddns hostname added' => 'Dynamic DNS hostname added', 'ddns hostname modified' => 'Dynamic DNS hostname modified', 'ddns hostname removed' => 'Dynamic DNS hostname removed', @@ -572,8 +580,12 @@ 'dhcp advopt unknown' => 'DHCP Option name not recognized', 'dhcp advopt value' => 'Option value', 'dhcp allow bootp' => 'Allow bootp clients', +'dhcp base ip fixed lease' => 'Base IP for creating fix leases', 'dhcp bootp pxe data' => 'Enter optional bootp pxe data for this fixed lease', 'dhcp configuration' => 'DHCP configuration', +'dhcp create fixed leases' => 'Create fixed leases', +'dhcp fixed lease err1' => 'For a fix lease you have to enter the MAC adress or the hostname, or you enter both.', +'dhcp fixed lease help1' => 'IP Adresses might be entered as FQDN', 'dhcp mode' => 'DHCP', 'dhcp server' => 'DHCP Server', 'dhcp server disabled' => 'DHCP server disabled. Stopped.', @@ -605,6 +617,7 @@ 'dmzpinholes for same net not necessary' => 'DMZ Pinholes are not necessary for same net. Select different source or destination net.', 'dns check failed' => 'DNS check failed', 'dns proxy server' => 'DNS proxy server', +'dns server' => 'DNS Server', 'do not log this port list' => 'Drop this port list just before they are logged (reduces log size)', 'dod' => 'Dial on Demand', 'dod for dns' => 'Dial on Demand for DNS:', @@ -667,6 +680,7 @@ 'encrypted' => 'Encrypted', 'end address' => 'End address:', 'err bk 1' => 'Error creating archive', +'err bk 10 password' => 'Error with Backup Password', 'err bk 2 key' => 'Error creating key file', 'err bk 3 tar' => 'Error appending files to archive', 'err bk 4 gz' => 'Error compressing archive', @@ -1135,6 +1149,7 @@ 'options fw' => 'Firewall options', 'optionsfw portlist hint' => 'The list of ports has to be comma separated (e.g. 137,138). You can specify up to a maximum of 15 ports per protocol.', 'optionsfw warning' => 'Modifying these options implies restart of firewall', +'or' => 'or', 'orange' => 'ORANGE', 'organization cant be empty' => 'Organization can\'t be empty.', 'organization name' => 'Organization Name', @@ -1181,10 +1196,19 @@ 'ovpnsys log' => 'OVPN-System-Log', 'package failed to install' => 'Package failed to install.', 'pagerefresh' => 'Page is beeing refreshed, please wait.', +'pakfire accept all' => 'Do you want to install all packages?', 'pakfire configuration' => 'Pakfire Configuration', +'pakfire install package' => 'You want ti install the following packages: ', +'pakfire installed addons' => 'Installed Addons:', +'pakfire possible dependency' => ' There may be depending packages, here is a list of packages that need to be installed.', +'pakfire register' => 'Register at master server:', +'pakfire update daily' => 'Run automatic Update daily:', +'pakfire updates' => 'Available Update:', +'pakfire working' => 'Pakfire ist working ... Please wait until everything is done successfull.', 'pap or chap' => 'PAP or CHAP', 'password' => 'Password:', 'password contains illegal characters' => 'Password contains illegal characters.', +'password crypting key' => 'Password crypting the key', 'password not set' => 'Password not set.', 'password too short' => 'Password is too short.', 'passwords do not match' => 'Passwords do not match.', @@ -1238,6 +1262,8 @@ 'proxy access graphs' => 'Proxy access graphs', 'proxy log viewer' => 'Proxy log viewer', 'proxy logs' => 'Proxy Logs', +'proxy no proxy extend' => 'or specify a list of not proxied destination', +'proxy no proxy local' => 'Disallow local proxying on blue/green networks', 'proxy port' => 'Proxy Port', 'psk' => 'PSK', 'pulse' => 'Pulse', @@ -1270,6 +1296,7 @@ 'remote logging' => 'Remote logging', 'remote subnet' => 'Remote subnet:', 'remote subnet is invalid' => 'Remote subnet is invalid.', +'removable device advice' => 'Plug in a device, refresh, select and mount before usage. Umount before removal.', 'remove' => 'Remove', 'remove ca certificate' => 'Remove CA Certificate', 'remove x509' => 'remove x509', @@ -1294,6 +1321,7 @@ 'reverse sort' => 'Sort in reverse chronological order', 'root' => 'Root', 'root certificate' => 'Root Certificate', +'root path' => 'root path', 'root user password' => 'root password', 'route subnet is invalid' => 'Additional push route subnet is invalid', 'router ip' => 'Router IP Address:', @@ -1302,6 +1330,7 @@ 'rsvd src port overlap' => 'Source Port Range overlaps a port reserved for IPFire:', 'rules already up to date' => 'Rules already up to date', 'running' => 'RUNNING', +'safe removal of umounted device' => 'You can safely remove the unmounted device', 'samba' => 'Samba', 'samba status' => 'Samba Status', 'saturday' => 'Saturday', @@ -1323,6 +1352,7 @@ 'security options' => 'Security Options', 'select' => 'Select', 'select dest net' => 'Select a destination net.', +'select media' => 'Select media
(only FAT supported for removable media)', 'select source net' => 'Select a source net. If you have no Orange or Blue net configured, you need no DMZ Pinholes.', 'selecttraffic' => 'Select utilization-overview:', 'send cr' => 'ISP requires Carriage Return:', @@ -1397,11 +1427,13 @@ 'speaker on' => 'Speaker on:', 'squid extension methods' => 'Your extension_methods list', 'squid extension methods invalid' => 'Your \'extension_methods\' list can only contain uppercase words of letters and digits, separated with a space. ', +'squid fix cache' => 'Repair cache', 'src port' => 'Src Port', 'srcprt range overlaps' => 'Source port range overlaps an already defined port.', 'srcprt within existing' => 'Source port is within an already defined port range.', 'ssdmz pinholes' => 'DMZ Pinholes', 'ssh access' => 'SSH Access', +'ssh access tip' => 'IPFire SSH is not using default port 222!', 'ssh fingerprint' => 'Fingerprint', 'ssh host keys' => 'SSH Host Keys', 'ssh is disabled' => 'SSH is disabled. Stopping.', @@ -1481,6 +1513,7 @@ 'toggle enable disable' => 'Enable or Disable', 'tone' => 'Tone', 'tone dial' => 'Tone dial:', +'too long 80 char max' => ' is too long, maximum allowed is 80 characters', 'total hits for log section' => 'Total Hits for Log Section', 'traffic back' => 'Back', 'traffic calc time' => 'Time of calculation', @@ -1514,6 +1547,8 @@ 'tripwirewarningpolicy' => 'WARNING - Your policy will be rebuild, after that your database will be reinitalised. Therefor the Site-Key and the Local-Ley are neeeded.', 'tuesday' => 'Tuesday', 'type' => 'type', +'umount' => 'Umount', +'umount removable media before to unplug' => 'Umount removable media before unplugging the device', 'unable to alter profiles while red is active' => 'Unable to alter profiles while RED is active.', 'unable to contact' => 'Unable to contact', 'unencrypted' => 'Unencrypted', @@ -1870,6 +1905,7 @@ 'workgroup' => 'Workgroup', 'written sectors' => 'Written Sectors', 'xtaccess all error' => 'You cannot set an external access to ALL, that is done in the port forwarding record.', +'xtaccess bad transfert' => 'If you specify a port destination range, the source range must be identical !', 'year' => 'Year', 'yearly firewallhits' => 'yearly firewallhits', 'yes' => 'Yes', diff --git a/src/misc-progs/backupctrl.c b/src/misc-progs/backupctrl.c index 120a51be46..b4ce67cb74 100644 --- a/src/misc-progs/backupctrl.c +++ b/src/misc-progs/backupctrl.c @@ -28,11 +28,11 @@ int main(int argc, char *argv[]) { fprintf (stderr, "Bad Argument!\n"); exit (1); } - elsif (strstr(argv[i], "|")){ + else if (strstr(argv[i], "|")){ fprintf (stderr, "Bad Argument!\n"); exit (1); } - elsif (argc > 2){ + else if (argc > 2){ fprintf (stderr, "Too Many Arguments!\n"); exit (1); } diff --git a/src/misc-progs/mpfirectrl.c b/src/misc-progs/mpfirectrl.c index 85244ca607..07b3e8f5c9 100644 --- a/src/misc-progs/mpfirectrl.c +++ b/src/misc-progs/mpfirectrl.c @@ -24,11 +24,11 @@ int main(int argc, char *argv[]) { snprintf(command, STRING_SIZE, "/var/ipfire/mpfire/bin/mpfire.pl"); for (i = 1; i < argc; i++) { - if (strstr(argv[i], "&&")){ - fprintf (stderr, "Bad Argument!\n"); - exit (1); - } - if (strstr(argv[i], "|")){ + if (strstr(argv[i], "&&")){ + fprintf (stderr, "Bad Argument!\n"); + exit (1); + } + else if (strstr(argv[i], "|")){ fprintf (stderr, "Bad Argument!\n"); exit (1); } diff --git a/src/misc-progs/sambactrl.c b/src/misc-progs/sambactrl.c index e9b2972db9..f81b295cc2 100644 --- a/src/misc-progs/sambactrl.c +++ b/src/misc-progs/sambactrl.c @@ -22,19 +22,19 @@ if (argc==1) fprintf (stderr, "Missing smbctrl command!\n"); return 1; } -elsif (strcmp(argv[1], "smbuserdisable")==0) +else if (strcmp(argv[1], "smbuserdisable")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -d %s >/dev/null", argv[2]); safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbuserenable")==0) +else if (strcmp(argv[1], "smbuserenable")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -e %s >/dev/null", argv[2]); safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbuserdelete")==0) +else if (strcmp(argv[1], "smbuserdelete")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -x %s >/dev/null", argv[2]); safe_system(command); @@ -42,27 +42,27 @@ snprintf(command, BUFFER_SIZE-1, "/usr/sbin/userdel %s >/dev/null", argv[2]); safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbsafeconf")==0) +else if (strcmp(argv[1], "smbsafeconf")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); return 0; } -elsif (strcmp(argv[1], "smbsafeconfcups")==0) +else if (strcmp(argv[1], "smbsafeconfcups")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares /var/ipfire/samba/printer > /var/ipfire/samba/smb.conf"); return 0; } -elsif (strcmp(argv[1], "smbsafeconfpdc")==0) +else if (strcmp(argv[1], "smbsafeconfpdc")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/pdc /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); return 0; } -elsif (strcmp(argv[1], "smbsafeconfpdccups")==0) +else if (strcmp(argv[1], "smbsafeconfpdccups")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/pdc /var/ipfire/samba/shares /var/ipfire/samba/printer > /var/ipfire/samba/smb.conf"); return 0; } -elsif (strcmp(argv[1], "smbglobalreset")==0) +else if (strcmp(argv[1], "smbglobalreset")==0) { safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/samba/settings"); @@ -70,47 +70,47 @@ safe_system("/bin/cat /var/ipfire/samba/default.global > /var/ipfire/samba/globa safe_system("/bin/cat /var/ipfire/samba/default.pdc > /var/ipfire/samba/pdc"); return 0; } -elsif (strcmp(argv[1], "smbsharesreset")==0) +else if (strcmp(argv[1], "smbsharesreset")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/default.shares > /var/ipfire/samba/smb.conf"); safe_system("/bin/cat /var/ipfire/samba/default.shares > /var/ipfire/samba/shares"); return 0; } -elsif (strcmp(argv[1], "smbprinterreset")==0) +else if (strcmp(argv[1], "smbprinterreset")==0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares /var/default.printer > /var/ipfire/samba/smb.conf"); safe_system("/bin/cat /var/ipfire/samba/default.printer > /var/ipfire/samba/printer"); return 0; } -elsif (strcmp(argv[1], "smbstop")==0) +else if (strcmp(argv[1], "smbstop")==0) { safe_system("/etc/rc.d/init.d/samba stop >/dev/null"); safe_system("/usr/local/bin/sambactrl disable"); return 0; } -elsif (strcmp(argv[1], "smbstart")==0) +else if (strcmp(argv[1], "smbstart")==0) { safe_system("/etc/rc.d/init.d/samba start >/dev/null"); safe_system("/usr/local/bin/sambactrl enable"); return 0; } -elsif (strcmp(argv[1], "smbrestart")==0) +else if (strcmp(argv[1], "smbrestart")==0) { safe_system("/etc/rc.d/init.d/samba restart >/dev/null"); return 0; } -elsif (strcmp(argv[1], "smbreload")==0) +else if (strcmp(argv[1], "smbreload")==0) { safe_system("/etc/rc.d/init.d/samba reload >/dev/null"); return 0; } -elsif (strcmp(argv[1], "smbstatus")==0) +else if (strcmp(argv[1], "smbstatus")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbstatus 2>/dev/null"); safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbuseradd")==0) +else if (strcmp(argv[1], "smbuseradd")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/sbin/groupadd sambauser >/dev/null"); safe_system(command); @@ -122,7 +122,7 @@ snprintf(command, BUFFER_SIZE-1, "/usr/bin/printf '%s\n%s\n' | /usr/bin/smbpassw safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbpcadd")==0) +else if (strcmp(argv[1], "smbpcadd")==0) { snprintf(command, BUFFER_SIZE-1, "/usr/sbin/groupadd sambawks >/dev/null"); safe_system(command); @@ -132,7 +132,7 @@ snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -a -m %s >/dev/null", argv[ safe_system(command); return 0; } -elsif (strcmp(argv[1], "smbchangepw")==0) +else if (strcmp(argv[1], "smbchangepw")==0) { snprintf(command, BUFFER_SIZE-1, "echo %s:%s | chpasswd", argv[2], argv[3]); safe_system(command); @@ -140,7 +140,7 @@ snprintf(command, BUFFER_SIZE-1, "/usr/bin/printf '%s\n%s\n' | /usr/bin/smbpassw safe_system(command); return 0; } -elsif (strcmp(argv[1], "readsmbpasswd")==0) +else if (strcmp(argv[1], "readsmbpasswd")==0) { safe_system("/bin/chown root:nobody /var/ipfire/samba/private >/dev/null"); safe_system("/bin/chown root:nobody /var/ipfire/samba/private/smbpasswd >/dev/null"); @@ -148,7 +148,7 @@ safe_system("/bin/chmod 640 /var/ipfire/samba/private/smbpasswd >/dev/null"); safe_system("/bin/chmod 650 /var/ipfire/samba/private >/dev/null"); return 0; } -elsif (strcmp(argv[1], "locksmbpasswd")==0) +else if (strcmp(argv[1], "locksmbpasswd")==0) { safe_system("/bin/chown root:root /var/ipfire/samba/private >/dev/null"); safe_system("/bin/chown root:root /var/ipfire/samba/private/smbpasswd >/dev/null"); @@ -156,7 +156,7 @@ safe_system("/bin/chmod 600 /var/ipfire/samba/private/smbpasswd >/dev/null"); safe_system("/bin/chmod 600 /var/ipfire/samba/private >/dev/null"); return 0; } -elsif (strcmp(argv[1], "enable")==0) +else if (strcmp(argv[1], "enable")==0) { safe_system("touch /var/ipfire/samba/enable"); safe_system("ln -snf /etc/rc.d/init.d/samba /etc/rc.d/rc3.d/S45samba"); @@ -164,7 +164,7 @@ safe_system("ln -snf /etc/rc.d/init.d/samba /etc/rc.d/rc0.d/K48samba"); safe_system("ln -snf /etc/rc.d/init.d/samba /etc/rc.d/rc6.d/K48samba"); return 0; } -elsif (strcmp(argv[1], "disable")==0) +else if (strcmp(argv[1], "disable")==0) { safe_system("unlink /var/ipfire/samba/enable"); safe_system("rm -rf /etc/rc.d/rc*.d/*samba"); -- 2.39.2