$settings{'ENABLED'} = 'off'; # Every check box must be set to off
$settings{'NAME'} = '';
my @nosaved=('IP','ENABLED','NAME'); # List here ALL setting2 fields. Mandatory
-
+
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
# Remove if no Setting1 needed
#
if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
-
+
#
#Validate static Settings1 here
#
unless ($errormessage) { # Everything is ok, save settings
- #map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
+ #map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved
#&General::writehash($setting, \%settings); # Save good settings
#$settings{'ACTION'} = $Lang::tr{'save'}; # Recreate 'ACTION'
#map ($settings{$_}= '',(@nosaved,'KEY1')); # and reinit var to empty
-
+
# Rebuild configuration file if needed
&BuildConfiguration;
$temp[2] = '' if ( $temp[2] eq '' );
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
-
+
&General::log($Lang::tr{'ip alias changed'});
-
+
#Save current
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
print FILE @current;
close(FILE);
-
+
# Rebuild configuration file
&BuildConfiguration;
# Handle Suricata related actions.
&HandleSuricata();
-
+
##
## if entering data line is repetitive, choose here to not erase fields between each addition
##
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
- splice (@current,$settings{'KEY1'},1); # Delete line
+ splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
print FILE @current;
close(FILE);
if ($settings{'ACTION'} eq '' ) { # First launch from GUI
$settings{'ENABLED'} ='on';
}
-
+
&Header::openpage($Lang::tr{'external aliases configuration'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
my %checked =(); # Checkbox manipulations
;
&Header::closebox();
}
-
+
#
# Second check box is for editing the list
#
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
sub SortDataFile
{
our %entries = ();
-
+
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
foreach my $line (@current) {
chomp( $line); #remove newline because can be on field 5 or 6 (addition of REMARK)
my @temp = split (',',$line);
-
+
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
-
+
# Exemple
# F1,F2,F3,F4,F5 only F1 F2 for sorting
# my @record = ('KEY',$key++,
# 'F1',$temp[0],
# 'F2',$temp[1],
# 'DATA',join(',',@temp[2..4]) ); #group remainning values, with separator (,)
-
+
# The KEY,key record permits doublons. If removed, then F1 becomes the key without doublon permitted.
-
-
+
+
my @record = ('KEY',$key++,'IP',$temp[0],'ENABLED',$temp[1],'NAME',$temp[2]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
-
+
open(FILE, ">$datafile") or die 'Unable to open aliases file.';
# Each field value is printed , with the newline ! Don't forget separator and order of them.
close (FILE);
}
-#
+#
# Build the configuration file for application aliases
#
sub BuildConfiguration {
my $value= `cat /sys/class/atm/$modem/parameters/$param`;
chomp($param);
chomp($value);
- if (!($param =~"uevent")
+ if (!($param =~"uevent")
&& !($param =~"resource")
&& !($param eq "")
) {
-
+
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>";
}else{
print "<tr bgcolor='$color{'color20'}'>";
}
- print "<td align='left'>$param</td><td align='left'>$value</td> ";
+ print "<td align='left'>$param</td><td align='left'>$value</td> ";
}
}
my @pfile = `grep . /sys/class/atm/$modem/device/* 2>/dev/null`;
my $value= `cat /sys/class/atm/$modem/device/$param`;
chomp($param);
chomp($value);
- if (!($param =~"uevent")
- && !($param =~"modalias")
+ if (!($param =~"uevent")
+ && !($param =~"modalias")
&& !($param =~"bInterface")
&& !($param =~"bAlternateSetting")
&& !($param =~"bNumEndpoints")
&& !($param =~"resource")
&& !($param eq "")
) {
-
+
$lines++;
if ($lines % 2){
print "<tr bgcolor='$color{'color22'}'>";
}else{
print "<tr bgcolor='$color{'color20'}'>";
}
- print "<td align='left'>$param</td><td align='left'>$value</td> ";
+ print "<td align='left'>$param</td><td align='left'>$value</td> ";
}
}
print "</table><br>\n";
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
-
+
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;
($name, $value) = split(/=/, $pair);
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # e.g. "%20" => " "
$value =~ s/[^a-zA-Z0-9]*//g; # a-Z 0-9 will pass
- $cgiin{$name} = $value;
+ $cgiin{$name} = $value;
}
}
}
# Read and sort the connection tracking table
-# do sorting
-if ($SORT_FIELD and $SORT_ORDER) {
+# do sorting
+if ($SORT_FIELD and $SORT_ORDER) {
# field sorting when sorting arguments are sane
open(CONNTRACK, "/usr/local/bin/getconntracktable | /usr/local/bin/consort.sh $SORT_FIELD $SORT_ORDER |") or die "Unable to read conntrack table";
} else {
# Add OpenVPN net for custom OVPNs
if (-e "${General::swroot}/ovpn/ccd.conf") {
- open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf");
+ open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf");
my @ovpnsub = <OVPNSUB>;
close(OVPNSUB);
foreach (@ovpnsub) {
my ($network, $mask) = split '/', (split ',', $_)[2];
-
+
$mask = ipv4_cidr2msk($mask) unless &General::validip($mask);
push(@network, $network);
{
$CONNSCHED::config[$cgiparams{'ID'}]{'ACTIVE'} = 'on';
}
-
+
&CONNSCHED::WriteConfig;
}
if ( $cgiparams{'ACTION'} eq 'edit' )
{
$i = $cgiparams{'ID'};
-
+
$selected_hour = substr($CONNSCHED::config[$i]{'TIME'},0,2);
$selected_minute = substr($CONNSCHED::config[$i]{'TIME'},3,2);
my $col="";
for my $id ( 0 .. $#CONNSCHED::config )
{
- if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) )
+ if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) )
{
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
print "<tr>";
$col="bgcolor='$color{'color20'}'";
}
- else
+ else
{
print "<tr>";
$col="bgcolor='$color{'color22'}'";
my @nosaved=();
my %color = ();
-#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS
+#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS
our $OptionTypes = 'boolean|((un)?signed )?integer (8|16|32)|ip-address|text|string|encapsulate \w+|array of ip-address';
&Header::showhttpheaders();
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
goto ERROR;
}
- if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"},
+ if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"},
$netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'};
goto ERROR;
}
}
-
+
if ($dhcpsettings{"END_ADDR_${itf}"}) {
if (!(&General::validip($dhcpsettings{"END_ADDR_${itf}"}))) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'};
goto ERROR;
}
- if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"},
+ if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"},
$netsettings{"${itf}_NETADDRESS"},
- $netsettings{"${itf}_NETMASK"})) {
+ $netsettings{"${itf}_NETMASK"})) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'};
goto ERROR;
}
goto ERROR;
}
if (! $dhcpsettings{"DNS1_${itf}"}) {
- $errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'};
+ $errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'};
goto ERROR;
}
}
if (! $dhcpsettings{"WINS1_${itf}"} ) {
$errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary wins without specifying primary'};
goto ERROR;
- }
+ }
}
if ($dhcpsettings{"NEXT_${itf}"}) {
if (!(&General::validip($dhcpsettings{"NEXT_${itf}"}))) {
&General::writehash($setting, \%dhcpsettings);
&sortcurrent2;
$dhcpsettings{'ACTION'} = 'SORT'; # create an 'ACTION'
- map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty
+ map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty
}
#Sorting of allocated leases
&Header::CheckSortOrder;
-## Now manipulate the two multi-line list with Settings2.
+## Now manipulate the two multi-line list with Settings2.
# '1' suffix is for ADVANCED OPTIONS
# '2' suffix is for FIXED LEASES
open(FILE, ">$filename1") or die 'Unable to open dhcp advanced options file.';
print FILE @current1;
close(FILE);
-
+
#Write changes to dhcpd.conf.
&buildconf;
}
-
+
if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' &&
$dhcpsettings{'SUBMIT'} ne $Lang::tr{'dhcp advopt help'}) {
if ($dhcpsettings{'ADVOPT_DATA'} eq '') {
$errormessage=$Lang::tr{'dhcp advopt blank value'};
}
-
+
# Test for a new option definition string (join field name & data)
if (ExistNewOptionDefinition ($dhcpsettings{'ADVOPT_NAME'} . ' ' . $dhcpsettings{'ADVOPT_DATA'})) {
#only edit permitted if option definition exists
}
unless ($errormessage) {
-
+
my $scope = '';
foreach my $itf (@ITFs) { # buils "RED,GREEN,ORANGE,... based on selection
$scope .= $dhcpsettings{"ADVOPT_SCOPE_${itf}"} eq 'on' ? "\t$itf" : "\toff" ;
if ($itf ne 'off') # Only is an interface name is read
{
$dhcpsettings{"ADVOPT_SCOPE_${itf}"} = 'on';
- }
+ }
}
}
open(FILE, ">$filename2") or die 'Unable to open fixed leases file.';
print FILE @current2;
close(FILE);
-
+
#Write changes to dhcpd.conf.
&buildconf;
}
if ($dhcpsettings{'FIX_NEXTADDR'}) {
unless(&General::validip($dhcpsettings{'FIX_NEXTADDR'})) { $errormessage = $Lang::tr{'invalid fixed ip address'}; }
}
-
+
my $key = 0;
CHECK:foreach my $line (@current2) {
my @temp = split(/\,/,$line);
# Also it may be needed to put duplicate fixed lease in their right subnet definition..
foreach my $itf (@ITFs) {
my $scoped = &General::IpInSubnet($dhcpsettings{'FIX_ADDR'},
- $netsettings{"${itf}_NETADDRESS"},
+ $netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"}) &&
$dhcpsettings{"ENABLE_${itf}"} eq 'on';
if ( $scoped &&
(lc($dhcpsettings{'FIX_MAC'}) eq lc($temp[0])) &&
&General::IpInSubnet($temp[1],
- $netsettings{"${itf}_NETADDRESS"},
+ $netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$errormessage = "$Lang::tr{'mac address in use'} $dhcpsettings{'FIX_MAC'}";
last CHECK;
END
;
-# Put a checkbox for each interface. Checkbox visible disabled if interface is disabled
+# Put a checkbox for each interface. Checkbox visible disabled if interface is disabled
foreach my $itf (@ITFs) {
my $lc_itf=lc($itf);
- $checked{'ADVOPT_SCOPE_${itf}'}{'on'} = $dhcpsettings{"ADVOPT_SCOPE_${itf}"} ne 'on' ? '' : "checked='checked'";
+ $checked{'ADVOPT_SCOPE_${itf}'}{'on'} = $dhcpsettings{"ADVOPT_SCOPE_${itf}"} ne 'on' ? '' : "checked='checked'";
print "$Lang::tr{\"${lc_itf}\"} <input type='checkbox' name='ADVOPT_SCOPE_${itf}' $checked{'ADVOPT_SCOPE_${itf}'}{'on'} ";
print $dhcpsettings{"ENABLE_${itf}"} eq 'on' ? "/>" : "disabled='disabled' />";
print " ";
print '<tr><td>wpad</td><td>code 252=text</td></tr>';
print '<tr><td>wpad</td><td>"http://www.server.fr/path-to/proxy.pac"</td></tr>';
print '</table>';
-
+
}
print <<END
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
if ($dhcpsettings{'KEY1'} eq $key) {
} elsif ($key % 2) {
print "<tr bgcolor='$color{'color22'}'>";
} else {
- print "<tr bgcolor='$color{'color20'}'>";
+ print "<tr bgcolor='$color{'color20'}'>";
}
print <<END
} else {
$global = $Lang::tr{'dhcp advopt scope global'};
}
-
-
+
+
# Print each checked interface
for (my $key=0; $key<@ITFs; $key++) {
my $itf = $temp[3+$key];
foreach my $line (@current2) {
my @temp = split(/\,/,$line);
$macdupl{$temp[0]} += 1;
- if ($macdupl{$temp[0]} > 1) {
+ if ($macdupl{$temp[0]} > 1) {
$ipdup = 1; # Flag up duplicates for use later
}
$ipinuse{$temp[1]} += 1;
- if ($ipinuse{$temp[1]} > 1) {
+ if ($ipinuse{$temp[1]} > 1) {
$ipdup = 1; # Flag up duplicates for use later
}
# Mark IP addresses outwith known subnets
$ipoutside{$temp[1]} = 1;
foreach my $itf (@ITFs) {
if ( &General::IpInSubnet($temp[1],
- $netsettings{"${itf}_NETADDRESS"},
+ $netsettings{"${itf}_NETADDRESS"},
$netsettings{"${itf}_NETMASK"})) {
$ipoutside{$temp[1]} = 0;
}
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
# Skip all entries that do not match the search query
my $TAG2 = '';
my $TAG3 = '';
my $TAG4 = '';
- if ($ipinuse{$temp[1]} > 1) {
+ if ($ipinuse{$temp[1]} > 1) {
$TAG0 = '<b>';
$TAG1 = '</b>';
}
- if ($macdupl{$temp[0]} > 1) {
+ if ($macdupl{$temp[0]} > 1) {
$TAG2 = '<b>';
$TAG3 = '</b>';
}
- if ($ipoutside{$temp[1]} > 0) {
+ if ($ipoutside{$temp[1]} > 0) {
$TAG4 = "bgcolor='orange'" if ($dhcpsettings{'KEY2'} ne $key);
}
# use combination of ether & IP as key to allow duplicates in either but not both
$entries{$record->{FETHER} . $record->{FIPADDR}} = $record; # add this to a hash of hashes
}
-
+
open(FILE, ">$filename2") or die 'Unable to open fixed lease file.';
foreach my $entry ( sort fixedleasesort keys %entries) {
print FILE "$entries{$entry}->{FETHER},$entries{$entry}->{FIPADDR},$entries{$entry}->{DATA}\n";
close (FILE);
undef (%entries); #This array is reused latter. Clear it.
}
-
+
# Build the configuration file mixing settings, fixed leases and advanced options
sub buildconf {
open(FILE, ">/${General::swroot}/dhcp/dhcpd.conf") or die "Unable to write dhcpd.conf file";
} else {
print FILE "ddns-update-style none;\n";
}
-
+
# Write first new option definition
foreach my $line (@current1) {
chomp($line); # remove newline
foreach my $line (@current1) {
chomp($line); # remove newline
my @temp = split(/\t/,$line);
-
+
if ($temp[0] eq 'on' && !ExistNewOptionDefinition ($temp[1] . ' ' . $temp[2])){ # active & !definition
my $global=1;
for (my $key=0; $key<@ITFs; $key++) {
if ($global) {
print FILE "option $temp[1] $temp[2];\n";
}
- }# on
+ }# on
}# foreach line
print FILE "\n";
foreach my $line (@current1) {
chomp($line); # remove newline
my @temp = split(/\t/,$line); # Use TAB separator !
-
+
if ($temp[0] eq 'on'){
for (my $key=0; $key<@ITFs; $key++) {
if ($itf eq $temp[3+$key]) # Only is an interface name is read
print FILE "\toption $temp[1] $temp[2];\n";
}
}
- }# on
+ }# on
}# foreach line
print FILE "} #$itf\n\n";
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
-
+
use strict;
# enable only the following on debugging purpose
;
&General::system("/usr/local/bin/extrahdctrl", "mount", "$extrahdsettings{'PATH'}");
}
-}
-elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'})
+}
+elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'})
{
if ( &General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) {
open( FILE, "< $devicefile" ) or die "Unable to read $devicefile";
&General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
-&General::readhash($fwoptions, \%optionsfw);
+&General::readhash($fwoptions, \%optionsfw);
&General::readhash($ifacesettings, \%ifaces);
&General::readhash("$configovpn", \%ovpnsettings);
&General::readhash("$configipsecrw", \%ipsecsettings);
if (&General::validport($_)){
push (@values,$_);
}else{
-
+
}
}
}
if (&General::validport($_)){
push (@values,$_);
}else{
-
+
}
}
}
# A Test if manual ip is part of dynamic openvpn subnet is made in getcolor
# because if one creates a custom host with the ip, we need to check the color there!
# It does not make sense to check this here
-
+
# Test if manual IP is part of an OpenVPN N2N subnet does also not make sense here
# Is also checked in getcolor
-
+
# Test if manual ip is part of an IPsec Network is also checked in getcolor
return 1;
}
sub checkvpncolor
{
-
+
}
sub deleterule
{
print"<tr><td valign='top'><input type='radio' name='$grp' id='ipsec_net_$srctgt' value='ipsec_net_$srctgt' $checked{$grp}{'ipsec_net_'.$srctgt}></td><td >$Lang::tr{'fwhost ipsec net'}</td><td align='right'><select name='ipsec_net_$srctgt' style='width:200px;'><select></td></tr>";
}
if ($show eq '1'){$show='';print"</select></td></tr>";}
-
+
print"</table>";
print"</td></tr></table><br>";
}
$fwdfwsettings{'RULE_ACTION'} = $hash{$key}[0];
$fwdfwsettings{'chain'} = $hash{$key}[1];
$fwdfwsettings{'ACTIVE'} = $hash{$key}[2];
- $fwdfwsettings{'grp1'} = $hash{$key}[3];
- $fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4];
- $fwdfwsettings{'grp2'} = $hash{$key}[5];
- $fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6];
+ $fwdfwsettings{'grp1'} = $hash{$key}[3];
+ $fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4];
+ $fwdfwsettings{'grp2'} = $hash{$key}[5];
+ $fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6];
$fwdfwsettings{'USE_SRC_PORT'} = $hash{$key}[7];
$fwdfwsettings{'PROT'} = $hash{$key}[8];
$fwdfwsettings{'ICMP_TYPES'} = $hash{$key}[9];
if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){
$fwdfwsettings{'oldorange'} ='on';
}
- }
+ }
}
# Split manual source and target address and delete the subnet
my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
#---TARGET------------------------------------------------------
&Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
print<<END;
- <table width='100%' border='0'>
+ <table width='100%' border='0'>
<tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr' checked></td><td width='60%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16' maxlength='18'><td width='1%'><input type='radio' name='grp2' id='ipfire' value='ipfire' $checked{'grp2'}{'ipfire'}></td><td><b>Firewall</b></td>
END
print"<td align='right'><select name='ipfire' style='width:200px;'>";
print"<tr><td width='12%'>$Lang::tr{'remark'}:</td><td width='88%' align='left'><input type='text' name='ruleremark' maxlength='255' value='$fwdfwsettings{'ruleremark'}' style='width:99%;'></td></tr>";
if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on'){
print "<tr><td width='12%'>$Lang::tr{'fwdfw rulepos'}:</td><td><select name='rulepos' >";
- for (my $count =1; $count <= $sum; $count++){
+ for (my $count =1; $count <= $sum; $count++){
print"<option value='$count' ";
print"selected='selected'" if($fwdfwsettings{'oldrulenumber'} eq $count);
print">$count</option>";
print "<option $selected{'TIME_FROM'}{$time}>$i:$j</option>\n";
}
}
- print<<END;
+ print<<END;
</select> ‐
<select name='TIME_TO'>
END
$color="$color{'color14'}";
$coloryellow='';
}elsif($coloryellow eq ''){
- if ($count % 2){
+ if ($count % 2){
$color="$color{'color22'}";
}
else{
$fwhostsettings{'netremark'} = $customnetwork{$key}[3];
$fwhostsettings{'count'} = $customnetwork{$key}[4];
delete $customnetwork{$key};
-
+
}
}
&General::writehasharray("$confignet", \%customnetwork);
#convert ip if leading '0' exists
$fwhostsettings{'IP'} = &Network::ip_remove_zero($fwhostsettings{'IP'});
- #check valid ip
+ #check valid ip
if (!&General::validipandmask($fwhostsettings{'IP'}."/".$fwhostsettings{'SUBNET'}))
{
$errormessage=$errormessage.$Lang::tr{'fwhost err addr'};
}
}
#only check plausi when no error till now
- if (!$errormessage){
+ if (!$errormessage){
&plausicheck("edithost");
}
if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newhost'} ne 'on' && $errormessage){
$customhost{$key}[3] = $fwhostsettings{'orgremark'};
&General::writehasharray("$confighost", \%customhost);
undef %customhost;
- }
+ }
if (!$errormessage){
#get count if host was edited
if($fwhostsettings{'actualize'} eq 'on'){
#check standard networks
if ($fwhostsettings{'grp2'} eq 'std_net'){
@target=$fwhostsettings{'DEFAULT_SRC_ADR'};
- $type='Standard Network';
+ $type='Standard Network';
}
#check custom networks
if ($fwhostsettings{'grp2'} eq 'cust_net' && $fwhostsettings{'CUST_SRC_NET'} ne ''){
$fwhostsettings{'remark'}='';
}
#check if host/net exists in grp
-
+
my $test="$grp,$fwhostsettings{'oldremark'},@target,$type";
foreach my $key (keys %customgrp) {
my $test1="$customgrp{$key}[0],$customgrp{$key}[1],$customgrp{$key}[2],$customgrp{$key}[3]";
}
}
}
-
+
if (!$errormessage){
#on first save, we have an empty @target, so fill it with nothing
my $targetvalues=@target;
{
$customgrp{$key}[1]='';
$customgrp{$key}[1]=$fwhostsettings{'newrem'};
- }
+ }
}
&General::writehasharray("$configgrp", \%customgrp);
$fwhostsettings{'update'}='on';
{
$customservicegrp{$key}[1]='';
$customservicegrp{$key}[1]=$fwhostsettings{'newsrvrem'};
- }
+ }
}
&General::writehasharray("$configsrvgrp", \%customservicegrp);
$fwhostsettings{'updatesrvgrp'}='on';
<tr><td colspan='6'></td></tr></table>
END
&Header::closebox();
-
+
}
# Add
sub addnet
if ($fwhostsettings{'ACTION'} eq 'edithost' || $fwhostsettings{'error'} eq 'on')
{
-
+
print " <td colspan='4' align='right'><input type='submit' value='$Lang::tr{'update'}' style='min-width:100px;'/><input type='hidden' name='ACTION' value='updatehost'><input type='hidden' name='orgremark' value='$fwhostsettings{'orgremark'}' ><input type='hidden' name='orgname' value='$fwhostsettings{'orgname'}' ><input type='hidden' name='update' value='on'><input type='hidden' name='newhost' value='$fwhostsettings{'newhost'}'></form>";
}else{
print " <td colspan='4' align='right'><input type='submit' name='savehost' value='$Lang::tr{'save'}' style='min-width:100px;' /><input type='hidden' name='ACTION' value='savehost' /><input type='hidden' name='newhost' value='on'>";
- }
+ }
print " </form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;' ><input type='hidden' name='ACTION' value='resethost'></form></td></tr></table>";
&Header::closebox();
}
$fwhostsettings{'oldgrpname'}=$fwhostsettings{'grp_name'};
my $grp=$fwhostsettings{'grp_name'};
my $rem=$fwhostsettings{'remark'};
- if ($fwhostsettings{'update'} eq ''){
+ if ($fwhostsettings{'update'} eq ''){
print<<END;
<table width='100%' border='0'>
<tr>
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);
- if (!keys %customnetwork)
- {
- print "<center><b>$Lang::tr{'fwhost empty'}</b>";
+ if (!keys %customnetwork)
+ {
+ print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table width='100%' cellspacing='0' class='tbl'>
print" <tr>";
$col="bgcolor='${Header::colouryellow}'";
}elsif ($count % 2)
- {
+ {
$col="bgcolor='$color{'color20'}'";
print" <tr>";
}else
}
print"</table>";
&Header::closebox();
- }
+ }
}
sub getcolor
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);
&General::readhasharray("$configgrp", \%customgrp);
- if (!keys %customhost)
- {
- print "<center><b>$Lang::tr{'fwhost empty'}</b>";
+ if (!keys %customhost)
+ {
+ print "<center><b>$Lang::tr{'fwhost empty'}</b>";
}else{
print<<END;
<table width='100%' cellspacing='0' class='tbl'>
my $delflag;
my @counter;
my %hash;
- if (!keys %customgrp)
+ if (!keys %customgrp)
{
print "<center><b>$Lang::tr{'fwhost err emptytable'}</b>";
}else{
print"<tr>";
$col="bgcolor='$color{'color22'}'";
}
- my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]);
+ my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]);
if ($ip eq ''){
print"<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
}
return 1;
-
+
}
sub checkgroup
{
}
sub checkip
{
-
+
my %hash=%{(shift)};
my $a=shift;
foreach my $key (keys %hash) {
foreach my $key (keys %customservicegrp) {
if( $customservicegrp{$key}[0] eq $fwhostsettings{'SRVGRP_NAME'} ){
$errormessage.=$Lang::tr{'fwhost err grpexist'}."<br>";
-
+
}
}
}
foreach my $network (sort keys %defaultNetworks)
{
return "$network" if ($val eq $defaultNetworks{$network}{'NAME'});
- }
+ }
}
sub gethostcount
{
}
}
&General::writehasharray("$config",\%hash);
-
+
}
sub plausicheck
{
$errormessage=$errormessage."<br>".$Lang::tr{'fwhost err netexist'};
$fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;}
- }
- #check if network ip already exists
+ }
+ #check if network ip already exists
if (!&checkip(\%customnetwork,1))
{
$errormessage=$errormessage."<br>".$Lang::tr{'fwhost err net'};
if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;}
- }
+ }
#check if host with this name already exists
&General::readhasharray("$confighost", \%customhost);
if (!&checkname(\%customhost))
my $name=$_[0],
my $type=$_[1];
my $value;
-
+
#get address from IPSEC NETWORK
if ($type eq 'IpSec Network'){
foreach my $key (keys %ipsecconf) {
}
&deletefromgrp($name,$configgrp);
}
-
+
#get address from IPSEC HOST
if ($type eq 'IpSec Host'){
foreach my $key (keys %ipsecconf) {
}
&deletefromgrp($name,$configgrp);
}
-
+
#get address from ovpn ccd Net-2-Net
if ($type eq 'OpenVPN N-2-N'){
foreach my $key (keys %ccdhost) {
}
&deletefromgrp($name,$configgrp);
}
-
+
#get address from ovpn ccd static host
if ($type eq 'OpenVPN static host'){
foreach my $key (keys %ccdhost) {
}
&deletefromgrp($name,$configgrp);
}
-
+
#get address from ovpn ccd static net
if ($type eq 'OpenVPN static network'){
foreach my $key (keys %ccdnet) {
}
}
}
-
+
#check custom addresses
if ($type eq 'Custom Host'){
foreach my $key (keys %customhost) {
}
}
}
-
+
##check custom networks
if ($type eq 'Custom Network'){
foreach my $key (keys %customnetwork) {
}
}
}
-
+
#check standard networks
if ($type eq 'Standard Network'){
if ($name =~ /OpenVPN/i){
}
}
}
-
+
if (($customgrp{$key}[0] eq $grp) && ($customgrp{$key}[3] eq 'Custom Host')){
foreach my $key2 (sort keys %customhost){
if ($customhost{$key2}[0] eq $customgrp{$key}[2]){
last;
}
}
-
+
}
}
&General::writehasharray("$confignet", \%customnetwork);
my $grp=$_[0];
&General::readhasharray("$configsrv", \%customservice);
&General::readhasharray("$configsrvgrp", \%customservicegrp);
-
+
foreach my $key (sort keys %customservicegrp){
if ($customservicegrp{$key}[0] eq $grp ){
foreach my $key2 (sort keys %customservice){
}
}
&General::writehasharray("$configsrv", \%customservice);
-
+
}
sub changenameinfw
{
}
sub checkports
{
-
+
my %hash=%{(shift)};
#check empty fields
if ($fwhostsettings{'SRV_NAME'} eq '' ){
}
#change dashes with :
$fwhostsettings{'SRV_PORT'}=~ tr/-/:/;
-
+
if ($fwhostsettings{'SRV_PORT'} eq "*") {
$fwhostsettings{'SRV_PORT'} = "1:65535";
}
unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~ @Graphs::time_ranges)) {
# Send HTTP headers
_start_svg_output();
-
- _print_error("URL parameters missing or malformed.");
+
+ _print_error("URL parameters missing or malformed.");
exit;
}
unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) {
# Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range]
my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}";
-
+
# Send HTTP redirect
print "Status: 302 Found\n";
print "Location: $location\n";
print "Content-type: text/html; charset=UTF-8\n";
print "\n"; # End of HTTP headers
-
+
print "Unsupported origin, request redirected to '$location'";
exit;
}
$Lang::tr{'gpl please read carefully the general public license and accept it below'}.
<br /><br />
END
-;
+;
if ( -e "/usr/share/doc/licenses/GPLv3" ) {
print '<textarea rows=\'25\' cols=\'75\' readonly=\'readonly\'>';
$settings{'DOM'} = '';
$settings{'PTR'} = '';
my @nosaved=('EN','IP','HOST','DOM','PTR'); # List here ALL setting2 fields. Mandatory
-
+
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
$temp[0] = $temp[0] ne '' ? '' : 'on'; # Toggle the field
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
-
+
&General::log($Lang::tr{'hosts config changed'});
#Save current
open(FILE, ">$datafile") or die 'hosts datafile error';
print FILE @current;
close(FILE);
-
+
# Rebuild configuration file
&BuildConfiguration;
}
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
&BuildConfiguration; # then re-build new host
-
+
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
- splice (@current,$settings{'KEY1'},1); # Delete line
+ splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'hosts datafile error';
print FILE @current;
close(FILE);
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
if ($temp[4] eq '' || $temp[4] eq 'on') {
sub SortDataFile
{
our %entries = ();
-
+
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
-
+
my @record = ('KEY',$key++,'EN',$temp[0],'IP',$temp[1],'HOST',$temp[2],'DOM',$temp[3],'PTR',$temp[4]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
-
+
open(FILE, ">$datafile") or die 'hosts datafile error';
# Each field value is printed , with the newline ! Don't forget separator and order of them.
chmod 0600, "${General::swroot}/ppp/secrets";
close FILE;
- &General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}");
+ &General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}");
$cgiparams{'ACTION'} = "$Lang::tr{'dial'}";
}
}
my %selected;
for ($c = 1; $c <= $maxprofiles; $c++) {
- $selected{'PROFILE'}{$c} = '';
+ $selected{'PROFILE'}{$c} = '';
}
$selected{'PROFILE'}{$pppsettings{'PROFILE'}} = "selected='selected'";
my $dialButtonDisabled = "disabled='disabled'";
# and root size should not vary during time
$warnmessage .= "<li>$Lang::tr{'filesystem full'}: $temp[0] <b>$Lang::tr{'free'}=$1M</b> !</li>";
}
-
+
} else {
# $line =~ m/^.* (\d+)m.*$/;
$line =~ m/^.* (\d+)\%.*$/;
}
$chainname = $chainstring[1];
- $chains{$chainname."start"} = $lines;
+ $chains{$chainname."start"} = $lines;
}
$lines++;
}
$chainname = $chainstring[1];
- $chainsman{$chainname."start"} = $manlines;
+ $chainsman{$chainname."start"} = $manlines;
}
$manlines++;
-
+
}
$chainsman{$chainname."end"} = $manlines-1;
close (FILE);
}
$chainname = $chainstring[1];
- $chainsnat{$chainname."start"} = $natlines;
+ $chainsnat{$chainname."start"} = $natlines;
}
$natlines++;
-
+
}
$chainsnat{$chainname."end"} = $natlines-1;
close (FILE);
my $commandline='';
-my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
+my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'},
<select name='DAY_BEGIN'>
END
;
-for ($day_begin = 1; $day_begin <= 31; $day_begin++)
+for ($day_begin = 1; $day_begin <= 31; $day_begin++)
{
print "\t<option ";
if ($day_begin == $reportsettings{'DAY_BEGIN'}) {
<select name='YEAR_BEGIN'>
END
;
-for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
+for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
{
print "\t<option ";
if ($year_begin == $reportsettings{'YEAR_BEGIN'}) {
<select name='DAY_END'>
END
;
-for ($day_end = 1; $day_end <= 31; $day_end++)
+for ($day_end = 1; $day_end <= 31; $day_end++)
{
print "\t<option ";
if ($day_end == $reportsettings{'DAY_END'}) {
<select name='YEAR_END'>
END
;
-for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
+for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
{
print "\t<option ";
if ($year_end == $reportsettings{'YEAR_END'}) {
{
my $xday;
-
+
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
print "$time $3\r\n";
-
+
}
exit 0;
}
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
- print "selected='selected' ";
+ print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
-for (my $day = 1; $day <= 31; $day++)
+for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
- print "selected='selected' ";
+ print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
-
+
my $next;
if ($start == $lastPageIndex) {
$next = -1;
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
- my $chain = $3;
+ my $chain = $3;
my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
if ($packet =~ /PHYSIN=(\w+)/) { $iface=$1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
my $servi = uc(getservbyport($srcport, lc($proto)));
if ($servi ne '' && $srcport < 1024) {
- $srcport = "$srcport($servi)";
+ $srcport = "$srcport($servi)";
}
$servi = uc(getservbyport($dstport, lc($proto)));
if ($servi ne '' && $dstport < 1024) {
my $col="";
if ($lines % 2) {
print "<tr>";
- $col="bgcolor='$color{'color20'}'";
+ $col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
- $col="bgcolor='$color{'color22'}'";
+ $col="bgcolor='$color{'color22'}'";
}
print <<END
print "<td align='center' width='50%'>";
if ($prev != -1) {
- print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
- print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
+ print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
- print "$Lang::tr{'first'} $Lang::tr{'older'}";
+ print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
- print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
- print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
+ print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
my $day = $cgiparams{'DAY'};
my $daystr='';
if ($day <= 9) {
- $daystr = " $day";
+ $daystr = " $day";
}
else {
$daystr = $day;
$lines++;
}
}
- close (FILE);
+ close (FILE);
}
$skip=0;
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
my $o;
if($cgiparams{'otherspie'} == 2 ){}
-else{
+else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
$lines++;
}
}
- close (FILE);
+ close (FILE);
}
$skip=0;
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
- print "selected='selected' ";
+ print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
- print "selected='selected' ";
+ print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
my $o;
if($cgiparams{'otherspie'} == 2 ){}
-else{
+else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];
# Get country code.
my $ccode = &Location::Functions::lookup_country_code($key[$s]);
-
+
$color++;
print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
my $o;
if($cgiparams{'otherspie'} == 2 ){}
-else{
+else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];
my @temp = split(',',$ ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
- $cgiparams{'DAY'} = $temp[2];
+ $cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
- my $lastleap=($year-1)%4;
+ my $lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$doy+366;
{
print "Content-type: text/plain\n\n";
print "IPFire IPS log\r\n";
- print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
+ print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
<select name='DAY'>
END
;
-for (my $day = 1; $day <= 31; $day++)
+for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
}
# If nothing has been fetched, the amount of lines is still zero.
-# In this case display a hint about no data.
+# In this case display a hint about no data.
unless ($lines) {
print "<tr><td bgcolor='$color{'color22'}' colspan='6' align='center'>$Lang::tr{'no entries'}</td></tr>\n";
}
my $tdoy = $now[7];
my $year = $now[5]+1900;
-$cgiparams{'DAY'} = $now[3];
+$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'SOURCE_IP'} = 'ALL';
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
if ($cgiparams{'ACTION'} eq $Lang::tr{'restore defaults'})
{
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
- $cgiparams{'ENABLE_FILTER'} = 'off';
+ $cgiparams{'ENABLE_FILTER'} = 'off';
}
{
my @temp = split(',',$ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
- $cgiparams{'DAY'} = $temp[2];
+ $cgiparams{'DAY'} = $temp[2];
$cgiparams{'SOURCE_IP'} = $temp[3];
$cgiparams{'USERNAME'} = &Header::escape($temp[4]);
}
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
- ( $cgiparams{'MONTH'} > $now[4] ) ) {
+ ( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$daystr = "$longmonths[$cgiparams{'MONTH'}] $daystr, ". int($year-1);
} else {
$temp_now[2] = $temp_now[1] = $temp_now[0] = 0; # start at 00:00:00
$temp_now[3] = 1 if ($cgiparams{'DAY'}==0); # All days selected, start at '1'
- my $mintime = POSIX::mktime(@temp_now);
+ my $mintime = POSIX::mktime(@temp_now);
my $maxtime;
if ($cgiparams{'DAY'}==0) { # full month
if ($temp_now[4]++ == 12){
$temp_now[4] = 0;
$temp_now[5]++;
};
- $maxtime = POSIX::mktime(@temp_now);
+ $maxtime = POSIX::mktime(@temp_now);
} else {
$maxtime = $mintime + 86400; # full day
}
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
- }
+ }
}
# finish loop when date of lines are past maxtime
{
print "Content-type: text/plain\n\n";
print "IPFire proxy log\r\n";
- print "$Lang::tr{'date'}: $daystr\r\n";
+ print "$Lang::tr{'date'}: $daystr\r\n";
print "Source IP: $cgiparams{'SOURCE_IP'}\r\n";
print "Username: $cgiparams{'USERNAME'}\r\n";
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
END
;
print "<option value='0'>$Lang::tr{'all'}</option>";
-for (my $day = 1; $day <= 31; $day++)
+for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
$url =~ /(^.{0,60})/;
my $part = $1;
- unless (length($part) < 60) { $part = "${part}..."; }
+ unless (length($part) < 60) { $part = "${part}..."; }
$url = &Header::cleanhtml($url,"y");
$part = &Header::cleanhtml($part,"y");
if ($cgiparams{'DAY'}==0) { # full month
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
# Extract ipv4 and ipv6 addresses
if (($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
- $srcaddr = $1;
+ $srcaddr = $1;
}
if($iface eq $country) {
}
}
}
- close (FILE);
+ close (FILE);
}
$skip=0;
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
- print "selected='selected' ";
+ print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
- $start = $lines - ${Header::viewsize};
+ $start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
if (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=.*)$/) {}
elsif (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {};
my $packet = $4;
- my $iface = '';
+ my $iface = '';
# If ipv6 uses bridge, use PHYSIN otherwise use IN
- if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
+ if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
if ( $1 =~ /2./ ){ $iface=""; }
my $srcaddr = '';
# Extract ipv4 and ipv6 addresses
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
- print "<tr bgcolor='${Header::table1colour}'>\n";
+ print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
- print "<tr bgcolor='${Header::table2colour}'>\n";
+ print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
print "<td align='center' width='50%'>";
if ($prev != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
}
else {
- print "$Lang::tr{'older'}";
+ print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
}
else {
- print "$Lang::tr{'newer'}";
+ print "$Lang::tr{'newer'}";
}
print "</td>\n";
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
}
}
}
- close (FILE);
+ close (FILE);
}
$skip=0;
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
- $start = $lines - ${Header::viewsize};
+ $start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
- print "<tr bgcolor='${Header::table1colour}'>\n";
+ print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
- print "<tr bgcolor='${Header::table2colour}'>\n";
+ print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
print "<td align='center' width='50%'>";
if ($prev != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
}
else {
- print "$Lang::tr{'older'}";
+ print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
}
else {
- print "$Lang::tr{'newer'}";
+ print "$Lang::tr{'newer'}";
}
print "</td>\n";
#
# This code is distributed under the terms of the GPL
#
-# JC HERITIER
+# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
#Aug 28 14:54:30 shite kernel: IN=ppp0 OUT= MAC= SRC=213.48.150.1
#DST=213.208.115.234 LEN=110 TOS=0x00 PREC=0x00 TTL=60 ID=30699 DF PROTO=TCP
-#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
+#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
use strict;
}
}
}
- close (FILE);
+ close (FILE);
}
$skip=0;
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
- $start = $lines - ${Header::viewsize};
+ $start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
- print "<tr bgcolor='${Header::table1colour}'>\n";
+ print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
- print "<tr bgcolor='${Header::table2colour}'>\n";
+ print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
print "<td align='center' width='50%'>";
if ($prev != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
}
else {
- print "$Lang::tr{'older'}";
+ print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
- print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
+ print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
}
else {
- print "$Lang::tr{'newer'}";
+ print "$Lang::tr{'newer'}";
}
print "</td>\n";
<select name='DAY'>
END
;
-for (my $day = 1; $day <= 31; $day++)
+for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@temp = split(',',$ ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
- $cgiparams{'DAY'} = $temp[2];
- $cgiparams{'LOGTYPE'} = $temp[3];
+ $cgiparams{'DAY'} = $temp[2];
+ $cgiparams{'LOGTYPE'} = $temp[3];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
- $lastleap=($year-1)%4;
+ $lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$tdoy+366;
print "Content-type: text/plain\n\n";
print "IPCop URL filter log\r\n";
print "Section: $cgiparams{'LOGTYPE'}\r\n";
- print "Date: $daystr $longmonthstr\r\n";
+ print "Date: $daystr $longmonthstr\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
<select name='DAY'>
END
;
-for ($day = 1; $day <= 31; $day++)
+for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
close(LOG);
}
}
- @log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
+ @log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
}
}
if ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
$macsettings{'MAC'} =~ s/\-/:/g;
my @mac = split(/:/,$macsettings{"MAC"});
- if ($#mac == 5) {
+ if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
- last;
+ last;
}
}
} else {
$macsettings{'MAC1'} =~ s/\-/:/g;
if ( not ($macsettings{'MAC1'} eq "" )) {
my @mac = split(/:/,$macsettings{"MAC1"});
- if ($#mac == 5) {
+ if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
- last;
+ last;
}
}
} else {
$macsettings{'MAC2'} =~ s/\-/:/g;
if ( not ($macsettings{'MAC2'} eq "" )) {
my @mac = split(/:/,$macsettings{"MAC2"});
- if ($#mac == 5) {
+ if ($#mac == 5) {
foreach (@mac) {
unless ($_ =~ /^[a-fA-F0-9]{1,2}$/) {
$errormessage = $Lang::tr{'mac address error not valid'};
- last;
+ last;
}
}
} else {
$macsettings{'MAC'} =~ s/\:/-/g;
$macsettings{'MAC1'} =~ s/\:/-/g;
$macsettings{'MAC2'} =~ s/\:/-/g;
- &General::writehash("${General::swroot}/mac/settings", \%macsettings);
- &Header::openbox('100%', 'left', $Lang::tr{'mac address saved'});
+ &General::writehash("${General::swroot}/mac/settings", \%macsettings);
+ &Header::openbox('100%', 'left', $Lang::tr{'mac address saved'});
print "<font class='base'>$Lang::tr{'mac address saved txt'}</font>\n";
&Header::closebox();
}
&General::system_background("/usr/local/bin/redctrl", "restart");
&Header::openbox('100%', 'left', $Lang::tr{'mac address recon'} );
print "<font class='base'>$Lang::tr{'mac address done'}</font>\n";
- &Header::closebox();
+ &Header::closebox();
}
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
system("cat /dev/null > ${General::swroot}/mac/settings &");
&Header::openbox('100%', 'left', $Lang::tr{'mac address deleted'} );
print "<font class='base'>$Lang::tr{'mac address deleted txt'}</font>\n";
- &Header::closebox();
+ &Header::closebox();
}
if ($macsettings{'ACTION'} eq $Lang::tr{'reboot'}) {
&General::log($Lang::tr{'rebooting ipfire'});
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
-print <<END
+print <<END
<input type="text" name="MAC" maxlength="17" value=''/></td>
END
;
-} else {
+} else {
print <<END
<input type="text" name="MAC" maxlength="17" value='$macsettings{"MAC"}'/></td>
END
-;
-}
-print <<END
+;
+}
+print <<END
</tr>
<tr>
<td> </td>
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
-print <<END
+print <<END
<input type="text" name="MAC1" maxlength="17" value=''/></td>
END
;
-} else {
+} else {
print <<END
<input type="text" name="MAC1" maxlength="17" value='$macsettings{"MAC1"}'/></td>
END
-;
-}
-print <<END
+;
+}
+print <<END
</tr>
<tr>
<td> </td>
END
;
if ($macsettings{'ACTION'} eq $Lang::tr{'delete'} ) {
-print <<END
+print <<END
<input type="text" name="MAC2" maxlength="17" value=''/></td>
END
;
-} else {
+} else {
print <<END
<input type="text" name="MAC2" maxlength="17" value='$macsettings{"MAC2"}'/></td>
END
-;
-}
+;
+}
-print <<END
+print <<END
</tr>
<tr>
<td colspan="2"><br><hr /></td>
<input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' />
END
;
-} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") {
+} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'} && $errormessage eq "") {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
<input type='submit' name='ACTION' value='$Lang::tr{'reconnect'}' />
END
;
-} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
+} elsif ($macsettings{'ACTION'} eq $Lang::tr{'save'}) {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
END
;
-} else {
+} else {
print <<END
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
-
+
use MIME::Lite;
-
+
#enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
$selected{'mail_tls'}{'explicit'} = 'selected' if exists $dma{'STARTTLS'};
$selected{'mail_tls'}{'implicit'} = 'selected' if (exists $dma{'SECURETRANSFER'}) and (not exists $dma{'STARTTLS'});
$selected{'mail_tls'}{'disabled'} = 'selected' if (not exists $dma{'SECURETRANSFER'}) and (not exists $dma{'STARTTLS'});
-
+
#Open site
&Header::openpage($Lang::tr{'email settings'}, 1, '');
&Header::openbigbox('100%', 'center');
&error;
&info;
&Header::openbox('100%', 'left', $Lang::tr{'email config'});
-
+
#### JAVA SCRIPT ####
print<<END;
<script>
</form>
END
&Header::closebox();
- &Header::closebigbox();
+ &Header::closebigbox();
&Header::closepage();
exit 0;
}
&Header::getcgihash(\%modemsettings);
if ($modemsettings{'ACTION'} eq $Lang::tr{'save'})
-{
+{
if (!($modemsettings{'TIMEOUT'} =~ /^\d+$/))
{
$errormessage = $Lang::tr{'timeout must be a number'};
goto ERROR;
}
-ERROR:
+ERROR:
if ($errormessage) {
$modemsettings{'VALID'} = 'no'; }
else {
if ($dhcpinfo{'dhcp_lease_time'} ne "") {
$lsetme=$dhcpinfo{'dhcp_lease_time'};
$lsetme=($lsetme/60);
-
+
if ($lsetme > 59) {
$lsetme=($lsetme/60); $leasetime=$lsetme." Hour";
}else{
$leasetime=$lsetme." Minute";
}
-
+
if ($lsetme > 1) {
$leasetime=$leasetime."s";
}
if ($dhcpinfo{'dhcp_renewal_time'} ne "") {
$rentme=$dhcpinfo{'dhcp_renewal_time'};
$rentme=($rentme/60);
-
+
if ($rentme > 59){
$rentme=($rentme/60); $rnwltime=$rentme." Hour";
}else{
$rnwltime=$rentme." Minute";
}
-
+
if ($rentme > 1){
$rnwltime=$rnwltime."s";
}
}
sub writeserverconf {
- my %sovpnsettings = ();
- my @temp = ();
+ my %sovpnsettings = ();
+ my @temp = ();
&General::readhash("${General::swroot}/ovpn/settings", \%sovpnsettings);
&read_routepushfile;
-
+
open(CONF, ">${General::swroot}/ovpn/server.conf") or die "Unable to open ${General::swroot}/ovpn/server.conf: $!";
flock CONF, 2;
print CONF "#OpenVPN Server conf\n";
print CONF "fragment $sovpnsettings{'FRAGMENT'}\n";
}
- if ($sovpnsettings{KEEPALIVE_1} > 0 && $sovpnsettings{KEEPALIVE_2} > 0) {
+ if ($sovpnsettings{KEEPALIVE_1} > 0 && $sovpnsettings{KEEPALIVE_2} > 0) {
print CONF "keepalive $sovpnsettings{'KEEPALIVE_1'} $sovpnsettings{'KEEPALIVE_2'}\n";
- }
+ }
print CONF "status-version 1\n";
print CONF "status /var/run/ovpnserver.log 30\n";
print CONF "ncp-disable\n";
if ($sovpnsettings{DHCP_WINS} ne '') {
print CONF "push \"dhcp-option WINS $sovpnsettings{DHCP_WINS}\"\n";
}
-
+
if ($sovpnsettings{MAX_CLIENTS} eq '') {
print CONF "max-clients 100\n";
}
if ($sovpnsettings{MAX_CLIENTS} ne '') {
print CONF "max-clients $sovpnsettings{MAX_CLIENTS}\n";
- }
+ }
print CONF "tls-verify /usr/lib/openvpn/verify\n";
print CONF "crl-verify /var/ipfire/ovpn/crls/cacrl.pem\n";
print CONF "user nobody\n";
close (LSC);
}
print CONF "\n";
-
+
close(CONF);
-}
+}
sub emptyserverlog{
if (open(FILE, ">/var/run/ovpnserver.log")) {
}
-sub delccdnet
+sub delccdnet
{
my %ccdconfhash = ();
my %ccdhash = ();
}
}
&General::writehasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
-
+
&writeserverconf;
return 0;
}
my $checkup;
my $ccdip;
my $baseaddress;
-
-
- #check name
- if ($ccdname eq '')
+
+
+ #check name
+ if ($ccdname eq '')
{
$errormessage=$errormessage.$Lang::tr{'ccd err name'}."<br>";
return
}
-
+
if(!&General::validhostname($ccdname))
{
$errormessage=$Lang::tr{'ccd err invalidname'};
return;
}
-
+
($ccdip,$subcidr) = split (/\//,$ccdnet);
$subcidr=&General::iporsubtocidr($subcidr);
#check subnet
sub modccdnet
{
-
+
my $newname=$_[0];
my $oldname=$_[1];
my %ccdconfhash=();
}
}
}
-
+
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%ccdhash);
foreach my $key (keys %ccdhash) {
if ($ccdhash{$key}[32] eq $oldname) {
last;
}
}
-
+
return 0;
}
sub ccdmaxclients
return $e-1;
}
-sub getccdadresses
+sub getccdadresses
{
my $ipin=$_[0];
my ($ip1,$ip2,$ip3,$ip4)=split /\./, $ipin;
sub fillselectbox
{
my $boxname=$_[1];
- my ($ccdip,$subcidr) = split("/",$_[0]);
+ my ($ccdip,$subcidr) = split("/",$_[0]);
my $tz=$_[2];
my @allccdips=&getccdadresses($ccdip,$subcidr,&ccdmaxclients($ccdip."/".$subcidr),$tz);
print"<select name='$boxname' STYLE='font-family : arial; font-size : 9pt; width:130px;' >";
open(FILE,"${General::swroot}/ovpn/routes_push");
while (<FILE>) {
$_=~s/\s*$//g;
-
+
my ($ip2,$cidr2) = split (/\//,"$_");
my $val2=$ip2."/".&General::iporsubtodec($cidr2);
-
+
if($val eq $val2){
return 0;
}
if (&General::IpInSubnet ($ip,$ip2,&General::cidrtosub($cidr2))){
return 0;
}
-
+
}
return 1;
}
if (&General::validip($ipdotmask)) { return 0; }
if (!($ipdotmask =~ /^(.*?)\/(.*?)$/)) { }
my $mask = $2;
- if (($mask =~ /\./ )) { return 0; }
+ if (($mask =~ /\./ )) { return 0; }
return 1;
}
if ($vpnsettings{'ROUTES_PUSH'} ne '') {
print FILE $vpnsettings{'ROUTES_PUSH'};
}
- close(FILE);
+ close(FILE);
}
sub read_routepushfile
while (<FILE>) { $vpnsettings{'ROUTES_PUSH'} .= $_ };
close(FILE);
$cgiparams{'ROUTES_PUSH'} = $vpnsettings{'ROUTES_PUSH'};
-
+
}
}
if ($cgiparams{'ACTION'} eq $Lang::tr{'start ovpn server'}){
&emptyserverlog();
&General::system("/usr/local/bin/openvpnctrl", "-s");
- }
+ }
#stop openvpn server
if ($cgiparams{'ACTION'} eq $Lang::tr{'stop ovpn server'}){
&General::system("/usr/local/bin/openvpnctrl", "-k");
- &emptyserverlog();
- }
+ &emptyserverlog();
+ }
# #restart openvpn server
# if ($cgiparams{'ACTION'} eq $Lang::tr{'restart ovpn server'}){
-#workarund, till SIGHUP also works when running as nobody
-# system('/usr/local/bin/openvpnctrl', '-r');
-# &emptyserverlog();
-# }
+#workarund, till SIGHUP also works when running as nobody
+# system('/usr/local/bin/openvpnctrl', '-r');
+# &emptyserverlog();
+# }
}
###
$vpnsettings{'DHCP_WINS'} = $cgiparams{'DHCP_WINS'};
$vpnsettings{'ROUTES_PUSH'} = $cgiparams{'ROUTES_PUSH'};
my @temp=();
-
+
if ($cgiparams{'FRAGMENT'} eq '') {
delete $vpnsettings{'FRAGMENT'};
} else {
- if ($cgiparams{'FRAGMENT'} !~ /^[0-9]+$/) {
+ if ($cgiparams{'FRAGMENT'} !~ /^[0-9]+$/) {
$errormessage = "Incorrect value, please insert only numbers.";
goto ADV_ERROR;
} else {
if ($cgiparams{'ROUTES_PUSH'} ne ''){
@temp = split(/\n/,$cgiparams{'ROUTES_PUSH'});
undef $vpnsettings{'ROUTES_PUSH'};
-
+
foreach my $tmpip (@temp)
{
s/^\s+//g; s/\s+$//g;
-
+
if ($tmpip)
{
- $tmpip=~s/\s*$//g;
+ $tmpip=~s/\s*$//g;
unless (&General::validipandmask($tmpip)) {
$errormessage = "$tmpip ".$Lang::tr{'ovpn errmsg invalid ip or mask'};
goto ADV_ERROR;
}
my ($ip, $cidr) = split("\/",&General::ipcidr2msk($tmpip));
-
+
if ($ip eq $netsettings{'GREEN_NETADDRESS'} && $cidr eq $netsettings{'GREEN_NETMASK'}) {
$errormessage = $Lang::tr{'ovpn errmsg green already pushed'};
goto ADV_ERROR;
}
-# a.marx ccd
+# a.marx ccd
my %ccdroutehash=();
&General::readhasharray("${General::swroot}/ovpn/ccdroute", \%ccdroutehash);
foreach my $key (keys %ccdroutehash) {
- foreach my $i (1 .. $#{$ccdroutehash{$key}}) {
+ foreach my $i (1 .. $#{$ccdroutehash{$key}}) {
if ( $ip."/".$cidr eq $ccdroutehash{$key}[$i] ){
$errormessage="Route $ip\/$cidr ".$Lang::tr{'ccd err inuse'}." $ccdroutehash{$key}[0]" ;
goto ADV_ERROR;
}
}
}
-
+
# ccd end
-
+
$vpnsettings{'ROUTES_PUSH'} .= $tmpip."\n";
}
}
goto ADV_ERROR;
}
if ($cgiparams{'KEEPALIVE_1'} ne '') {
- if ($cgiparams{'KEEPALIVE_1'} !~ /^[0-9]+$/) {
+ if ($cgiparams{'KEEPALIVE_1'} !~ /^[0-9]+$/) {
$errormessage = $Lang::tr{'invalid input for keepalive 1'};
goto ADV_ERROR;
}
}
if ($cgiparams{'KEEPALIVE_2'} ne ''){
- if ($cgiparams{'KEEPALIVE_2'} !~ /^[0-9]+$/) {
+ if ($cgiparams{'KEEPALIVE_2'} !~ /^[0-9]+$/) {
$errormessage = $Lang::tr{'invalid input for keepalive 2'};
goto ADV_ERROR;
}
}
if ($cgiparams{'KEEPALIVE_2'} < ($cgiparams{'KEEPALIVE_1'} * 2)){
$errormessage = $Lang::tr{'invalid input for keepalive 1:2'};
- goto ADV_ERROR;
+ goto ADV_ERROR;
}
&General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
&writeserverconf();#hier ok
my $tunmtu = '';
unless(-d "${General::swroot}/ovpn/n2nconf/"){mkdir "${General::swroot}/ovpn/n2nconf", 0755 or die "Unable to create dir $!";}
-unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}", 0770 or die "Unable to create dir $!";}
+unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}", 0770 or die "Unable to create dir $!";}
open(SERVERCONF, ">${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Unable to open ${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf: $!";
-
+
flock SERVERCONF, 2;
- print SERVERCONF "# IPFire n2n Open VPN Server Config by ummeegge und m.a.d\n";
- print SERVERCONF "\n";
+ print SERVERCONF "# IPFire n2n Open VPN Server Config by ummeegge und m.a.d\n";
+ print SERVERCONF "\n";
print SERVERCONF "# User Security\n";
print SERVERCONF "user nobody\n";
print SERVERCONF "group nobody\n";
print SERVERCONF "persist-tun\n";
print SERVERCONF "persist-key\n";
print SERVERCONF "script-security 2\n";
- print SERVERCONF "# IP/DNS for remote Server Gateway\n";
+ print SERVERCONF "# IP/DNS for remote Server Gateway\n";
if ($cgiparams{'REMOTE'} ne '') {
print SERVERCONF "remote $cgiparams{'REMOTE'}\n";
}
print SERVERCONF "float\n";
- print SERVERCONF "# IP adresses of the VPN Subnet\n";
- print SERVERCONF "ifconfig $ovsubnet.1 $ovsubnet.2\n";
- print SERVERCONF "# Client Gateway Network\n";
+ print SERVERCONF "# IP adresses of the VPN Subnet\n";
+ print SERVERCONF "ifconfig $ovsubnet.1 $ovsubnet.2\n";
+ print SERVERCONF "# Client Gateway Network\n";
print SERVERCONF "route $remsubnet[0] $remsubnet[1]\n";
print SERVERCONF "up \"/etc/init.d/static-routes start\"\n";
- print SERVERCONF "# tun Device\n";
- print SERVERCONF "dev tun\n";
+ print SERVERCONF "# tun Device\n";
+ print SERVERCONF "dev tun\n";
print SERVERCONF "#Logfile for statistics\n";
print SERVERCONF "status-version 1\n";
print SERVERCONF "status /var/run/openvpn/$cgiparams{'NAME'}-n2n 10\n";
- print SERVERCONF "# Port and Protokol\n";
- print SERVERCONF "port $cgiparams{'DEST_PORT'}\n";
+ print SERVERCONF "# Port and Protokol\n";
+ print SERVERCONF "port $cgiparams{'DEST_PORT'}\n";
if ($cgiparams{'PROTOCOL'} eq 'tcp') {
print SERVERCONF "proto tcp4-server\n";
if ($cgiparams{'MTU'} eq '') {$tunmtu = '1400'} else {$tunmtu = $cgiparams{'MTU'}};
print SERVERCONF "tun-mtu $tunmtu\n";
}
-
+
if ($cgiparams{'PROTOCOL'} eq 'udp') {
print SERVERCONF "proto udp4\n";
print SERVERCONF "# Paketsize\n";
if ($cgiparams{'MTU'} eq '') {$tunmtu = '1500'} else {$tunmtu = $cgiparams{'MTU'}};
print SERVERCONF "tun-mtu $tunmtu\n";
- if ($cgiparams{'FRAGMENT'} ne '') {print SERVERCONF "fragment $cgiparams{'FRAGMENT'}\n";}
+ if ($cgiparams{'FRAGMENT'} ne '') {print SERVERCONF "fragment $cgiparams{'FRAGMENT'}\n";}
if ($cgiparams{'MSSFIX'} eq 'on') {print SERVERCONF "mssfix\n"; } else { print SERVERCONF "mssfix 0\n" };
}
- print SERVERCONF "# Auth. Server\n";
- print SERVERCONF "tls-server\n";
- print SERVERCONF "ca ${General::swroot}/ovpn/ca/cacert.pem\n";
- print SERVERCONF "cert ${General::swroot}/ovpn/certs/servercert.pem\n";
- print SERVERCONF "key ${General::swroot}/ovpn/certs/serverkey.pem\n";
+ print SERVERCONF "# Auth. Server\n";
+ print SERVERCONF "tls-server\n";
+ print SERVERCONF "ca ${General::swroot}/ovpn/ca/cacert.pem\n";
+ print SERVERCONF "cert ${General::swroot}/ovpn/certs/servercert.pem\n";
+ print SERVERCONF "key ${General::swroot}/ovpn/certs/serverkey.pem\n";
print SERVERCONF "dh ${General::swroot}/ovpn/ca/$cgiparams{'DH_NAME'}\n";
- print SERVERCONF "# Cipher\n";
+ print SERVERCONF "# Cipher\n";
print SERVERCONF "cipher $cgiparams{'DCIPHER'}\n";
# If GCM cipher is used, do not use --auth
print SERVERCONF "# Enable Compression\n";
print SERVERCONF "comp-lzo\n";
}
- print SERVERCONF "# Debug Level\n";
- print SERVERCONF "verb 3\n";
- print SERVERCONF "# Tunnel check\n";
- print SERVERCONF "keepalive 10 60\n";
- print SERVERCONF "# Start as daemon\n";
- print SERVERCONF "daemon $cgiparams{'NAME'}n2n\n";
- print SERVERCONF "writepid /var/run/$cgiparams{'NAME'}n2n.pid\n";
- print SERVERCONF "# Activate Management Interface and Port\n";
+ print SERVERCONF "# Debug Level\n";
+ print SERVERCONF "verb 3\n";
+ print SERVERCONF "# Tunnel check\n";
+ print SERVERCONF "keepalive 10 60\n";
+ print SERVERCONF "# Start as daemon\n";
+ print SERVERCONF "daemon $cgiparams{'NAME'}n2n\n";
+ print SERVERCONF "writepid /var/run/$cgiparams{'NAME'}n2n.pid\n";
+ print SERVERCONF "# Activate Management Interface and Port\n";
if ($cgiparams{'OVPN_MGMT'} eq '') {print SERVERCONF "management localhost $cgiparams{'DEST_PORT'}\n"}
else {print SERVERCONF "management localhost $cgiparams{'OVPN_MGMT'}\n"};
close(SERVERCONF);
my $ovsubnet = "$ovsubnettemp[0].$ovsubnettemp[1].$ovsubnettemp[2]";
my @remsubnet = split(/\//,$cgiparams{'REMOTE_SUBNET'});
my $tunmtu = '';
-
+
unless(-d "${General::swroot}/ovpn/n2nconf/"){mkdir "${General::swroot}/ovpn/n2nconf", 0755 or die "Unable to create dir $!";}
unless(-d "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}"){mkdir "${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}", 0770 or die "Unable to create dir $!";}
-
+
open(CLIENTCONF, ">${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Unable to open ${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf: $!";
-
+
flock CLIENTCONF, 2;
print CLIENTCONF "# IPFire rewritten n2n Open VPN Client Config by ummeegge und m.a.d\n";
- print CLIENTCONF "#\n";
+ print CLIENTCONF "#\n";
print CLIENTCONF "# User Security\n";
print CLIENTCONF "user nobody\n";
print CLIENTCONF "group nobody\n";
print CLIENTCONF "persist-tun\n";
print CLIENTCONF "persist-key\n";
print CLIENTCONF "script-security 2\n";
- print CLIENTCONF "# IP/DNS for remote Server Gateway\n";
+ print CLIENTCONF "# IP/DNS for remote Server Gateway\n";
print CLIENTCONF "remote $cgiparams{'REMOTE'}\n";
print CLIENTCONF "float\n";
- print CLIENTCONF "# IP adresses of the VPN Subnet\n";
- print CLIENTCONF "ifconfig $ovsubnet.2 $ovsubnet.1\n";
- print CLIENTCONF "# Server Gateway Network\n";
- print CLIENTCONF "route $remsubnet[0] $remsubnet[1]\n";
+ print CLIENTCONF "# IP adresses of the VPN Subnet\n";
+ print CLIENTCONF "ifconfig $ovsubnet.2 $ovsubnet.1\n";
+ print CLIENTCONF "# Server Gateway Network\n";
+ print CLIENTCONF "route $remsubnet[0] $remsubnet[1]\n";
print CLIENTCONF "up \"/etc/init.d/static-routes start\"\n";
- print CLIENTCONF "# tun Device\n";
- print CLIENTCONF "dev tun\n";
+ print CLIENTCONF "# tun Device\n";
+ print CLIENTCONF "dev tun\n";
print CLIENTCONF "#Logfile for statistics\n";
print CLIENTCONF "status-version 1\n";
print CLIENTCONF "status /var/run/openvpn/$cgiparams{'NAME'}-n2n 10\n";
- print CLIENTCONF "# Port and Protokol\n";
- print CLIENTCONF "port $cgiparams{'DEST_PORT'}\n";
+ print CLIENTCONF "# Port and Protokol\n";
+ print CLIENTCONF "port $cgiparams{'DEST_PORT'}\n";
if ($cgiparams{'PROTOCOL'} eq 'tcp') {
print CLIENTCONF "proto tcp4-client\n";
if ($cgiparams{'MTU'} eq '') {$tunmtu = '1400'} else {$tunmtu = $cgiparams{'MTU'}};
print CLIENTCONF "tun-mtu $tunmtu\n";
}
-
+
if ($cgiparams{'PROTOCOL'} eq 'udp') {
print CLIENTCONF "proto udp4\n";
print CLIENTCONF "# Paketsize\n";
} else {
print CLIENTCONF "remote-cert-tls server\n";
}
- print CLIENTCONF "# Auth. Client\n";
- print CLIENTCONF "tls-client\n";
- print CLIENTCONF "# Cipher\n";
+ print CLIENTCONF "# Auth. Client\n";
+ print CLIENTCONF "tls-client\n";
+ print CLIENTCONF "# Cipher\n";
print CLIENTCONF "cipher $cgiparams{'DCIPHER'}\n";
print CLIENTCONF "pkcs12 ${General::swroot}/ovpn/certs/$cgiparams{'NAME'}.p12\r\n";
print CLIENTCONF "# Enable Compression\n";
print CLIENTCONF "comp-lzo\n";
}
- print CLIENTCONF "# Debug Level\n";
- print CLIENTCONF "verb 3\n";
- print CLIENTCONF "# Tunnel check\n";
- print CLIENTCONF "keepalive 10 60\n";
- print CLIENTCONF "# Start as daemon\n";
+ print CLIENTCONF "# Debug Level\n";
+ print CLIENTCONF "verb 3\n";
+ print CLIENTCONF "# Tunnel check\n";
+ print CLIENTCONF "keepalive 10 60\n";
+ print CLIENTCONF "# Start as daemon\n";
print CLIENTCONF "daemon $cgiparams{'NAME'}n2n\n";
- print CLIENTCONF "writepid /var/run/$cgiparams{'NAME'}n2n.pid\n";
- print CLIENTCONF "# Activate Management Interface and Port\n";
+ print CLIENTCONF "writepid /var/run/$cgiparams{'NAME'}n2n.pid\n";
+ print CLIENTCONF "# Activate Management Interface and Port\n";
if ($cgiparams{'OVPN_MGMT'} eq '') {print CLIENTCONF "management localhost $cgiparams{'DEST_PORT'}\n"}
else {print CLIENTCONF "management localhost $cgiparams{'OVPN_MGMT'}\n"};
close(CLIENTCONF);
goto SETTINGS_ERROR;
}
my @tmpovpnsubnet = split("\/",$cgiparams{'DOVPN_SUBNET'});
-
- if (&General::IpInSubnet ( $netsettings{'RED_ADDRESS'},
+
+ if (&General::IpInSubnet ( $netsettings{'RED_ADDRESS'},
$tmpovpnsubnet[0], $tmpovpnsubnet[1])) {
$errormessage = "$Lang::tr{'ovpn subnet overlap'} IPFire RED Network $netsettings{'RED_ADDRESS'}";
goto SETTINGS_ERROR;
}
-
- if (&General::IpInSubnet ( $netsettings{'GREEN_ADDRESS'},
+
+ if (&General::IpInSubnet ( $netsettings{'GREEN_ADDRESS'},
$tmpovpnsubnet[0], $tmpovpnsubnet[1])) {
$errormessage = "$Lang::tr{'ovpn subnet overlap'} IPFire Green Network $netsettings{'GREEN_ADDRESS'}";
goto SETTINGS_ERROR;
}
- if (&General::IpInSubnet ( $netsettings{'BLUE_ADDRESS'},
+ if (&General::IpInSubnet ( $netsettings{'BLUE_ADDRESS'},
$tmpovpnsubnet[0], $tmpovpnsubnet[1])) {
$errormessage = "$Lang::tr{'ovpn subnet overlap'} IPFire Blue Network $netsettings{'BLUE_ADDRESS'}";
goto SETTINGS_ERROR;
}
-
- if (&General::IpInSubnet ( $netsettings{'ORANGE_ADDRESS'},
+
+ if (&General::IpInSubnet ( $netsettings{'ORANGE_ADDRESS'},
$tmpovpnsubnet[0], $tmpovpnsubnet[1])) {
$errormessage = "$Lang::tr{'ovpn subnet overlap'} IPFire Orange Network $netsettings{'ORANGE_ADDRESS'}";
goto SETTINGS_ERROR;
chomp($_);
my @tempalias = split(/\,/,$_);
if ($tempalias[1] eq 'on') {
- if (&General::IpInSubnet ($tempalias[0] ,
+ if (&General::IpInSubnet ($tempalias[0] ,
$tmpovpnsubnet[0], $tmpovpnsubnet[1])) {
$errormessage = "$Lang::tr{'ovpn subnet overlap'} IPFire alias entry $tempalias[0]";
- }
+ }
}
}
close(ALIASES);
$errormessage = $Lang::tr{'invalid mtu input'};
goto SETTINGS_ERROR;
}
-
+
unless (&General::validport($cgiparams{'DDEST_PORT'})) {
$errormessage = $Lang::tr{'invalid port'};
goto SETTINGS_ERROR;
unlink("${General::swroot}/ovpn/enable");
}
-#new settings for daemon
+#new settings for daemon
&General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings);
&writeserverconf();#hier ok
SETTINGS_ERROR:
exit(0);
}
-
+
###
### Download host certificate
###
# refresh
#system ('/bin/touch', "${General::swroot}/ovpn/gencanow");
-
+
# Create the CA certificate
my $pid = open(OPENSSL, "|-");
$SIG{ALRM} = sub { $errormessage = $Lang::tr{'broken pipe'}; goto ROOTCERT_ERROR;};
goto ROOTCERT_ERROR;
}
}
-
+
# Sign the host certificate request
# This system call is safe, because all argeuments are passed as an array.
system('/usr/bin/openssl', 'ca', '-days', '999999',
unlink ("${General::swroot}/ovpn/certs/serverkey.pem");
unlink ("${General::swroot}/ovpn/certs/servercert.pem");
unlink ("${General::swroot}/ovpn/ca/cacert.pem");
- unlink ("${General::swroot}/ovpn/crls/cacrl.pem");
+ unlink ("${General::swroot}/ovpn/crls/cacrl.pem");
&cleanssldatabase();
goto ROOTCERT_ERROR;
# } else {
<td class='base' nowrap='nowrap'><input type='text' name='ROOTCERT_STATE' value='$cgiparams{'ROOTCERT_STATE'}' size='32' /></td>
<td colspan='2'> </td></tr>
<tr><td class='base'>$Lang::tr{'country'}:</td>
- <td class='base'><select name='ROOTCERT_COUNTRY'>
+ <td class='base'><select name='ROOTCERT_COUNTRY'>
END
;
<tr><td> </td>
<td><input type='submit' name='ACTION' value='$Lang::tr{'generate root/host certificates'}' /></td>
- <td> </td><td> </td></tr>
+ <td> </td><td> </td></tr>
<tr><td class='base' colspan='4' align='left'>
<img src='/blob.gif' valign='top' alt='*' /> $Lang::tr{'required field'}</td></tr>
<tr><td colspan='2'><br></td></tr>
###
}elsif ($cgiparams{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
-
+
&General::readhash("${General::swroot}/ovpn/settings", \%vpnsettings);
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
my $n2nactive = '';
if(grep(/$confighash{$cgiparams{'KEY'}}[1]/, @ps)) {
$n2nactive = "1";
}
-
+
if ($confighash{$cgiparams{'KEY'}}) {
if ($confighash{$cgiparams{'KEY'}}[0] eq 'off') {
$confighash{$cgiparams{'KEY'}}[0] = 'on';
###
if ($confighash{$cgiparams{'KEY'}}[3] eq 'net'){
-
+
my $zipname = "$confighash{$cgiparams{'KEY'}}[1]-Client.zip";
my $zippathname = "$zippath$zipname";
- $clientovpn = "$confighash{$cgiparams{'KEY'}}[1].conf";
+ $clientovpn = "$confighash{$cgiparams{'KEY'}}[1].conf";
my @ovsubnettemp = split(/\./,$confighash{$cgiparams{'KEY'}}[27]);
my $ovsubnet = "$ovsubnettemp[0].$ovsubnettemp[1].$ovsubnettemp[2]";
- my $tunmtu = '';
+ my $tunmtu = '';
my @remsubnet = split(/\//,$confighash{$cgiparams{'KEY'}}[8]);
my $n2nfragment = '';
-
+
open(CLIENTCONF, ">$tempdir/$clientovpn") or die "Unable to open tempfile: $!";
flock CLIENTCONF, 2;
-
+
my $zip = Archive::Zip->new();
print CLIENTCONF "# IPFire n2n Open VPN Client Config by ummeegge und m.a.d\n";
print CLIENTCONF "# \n";
print CLIENTCONF "persist-tun\n";
print CLIENTCONF "persist-key\n";
print CLIENTCONF "script-security 2\n";
- print CLIENTCONF "# IP/DNS for remote Server Gateway\n";
+ print CLIENTCONF "# IP/DNS for remote Server Gateway\n";
print CLIENTCONF "remote $vpnsettings{'VPN_IP'}\n";
print CLIENTCONF "float\n";
- print CLIENTCONF "# IP adresses of the VPN Subnet\n";
- print CLIENTCONF "ifconfig $ovsubnet.2 $ovsubnet.1\n";
- print CLIENTCONF "# Server Gateway Network\n";
+ print CLIENTCONF "# IP adresses of the VPN Subnet\n";
+ print CLIENTCONF "ifconfig $ovsubnet.2 $ovsubnet.1\n";
+ print CLIENTCONF "# Server Gateway Network\n";
print CLIENTCONF "route $remsubnet[0] $remsubnet[1]\n";
- print CLIENTCONF "# tun Device\n";
- print CLIENTCONF "dev tun\n";
+ print CLIENTCONF "# tun Device\n";
+ print CLIENTCONF "dev tun\n";
print CLIENTCONF "#Logfile for statistics\n";
print CLIENTCONF "status-version 1\n";
print CLIENTCONF "status /var/run/openvpn/$cgiparams{'NAME'}-n2n 10\n";
- print CLIENTCONF "# Port and Protokoll\n";
- print CLIENTCONF "port $confighash{$cgiparams{'KEY'}}[29]\n";
-
+ print CLIENTCONF "# Port and Protokoll\n";
+ print CLIENTCONF "port $confighash{$cgiparams{'KEY'}}[29]\n";
+
if ($confighash{$cgiparams{'KEY'}}[28] eq 'tcp') {
print CLIENTCONF "proto tcp4-client\n";
print CLIENTCONF "# Packet size\n";
if ($confighash{$cgiparams{'KEY'}}[31] eq '') {$tunmtu = '1400'} else {$tunmtu = $confighash{$cgiparams{'KEY'}}[31]};
print CLIENTCONF "tun-mtu $tunmtu\n";
}
-
+
if ($confighash{$cgiparams{'KEY'}}[28] eq 'udp') {
print CLIENTCONF "proto udp4\n";
print CLIENTCONF "# Paketsize\n";
} else {
print CLIENTCONF "remote-cert-tls server\n";
}
- print CLIENTCONF "# Auth. Client\n";
- print CLIENTCONF "tls-client\n";
+ print CLIENTCONF "# Auth. Client\n";
+ print CLIENTCONF "tls-client\n";
print CLIENTCONF "# Cipher\n";
print CLIENTCONF "cipher $confighash{$cgiparams{'KEY'}}[40]\n";
- if ($confighash{$cgiparams{'KEY'}}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12") {
+ if ($confighash{$cgiparams{'KEY'}}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12") {
print CLIENTCONF "pkcs12 ${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12\r\n";
$zip->addFile( "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12", "$confighash{$cgiparams{'KEY'}}[1].p12") or die "Can't add file $confighash{$cgiparams{'KEY'}}[1].p12\n";
}
print CLIENTCONF "# Enable Compression\n";
print CLIENTCONF "comp-lzo\n";
}
- print CLIENTCONF "# Debug Level\n";
- print CLIENTCONF "verb 3\n";
- print CLIENTCONF "# Tunnel check\n";
- print CLIENTCONF "keepalive 10 60\n";
- print CLIENTCONF "# Start as daemon\n";
- print CLIENTCONF "daemon $confighash{$cgiparams{'KEY'}}[1]n2n\n";
- print CLIENTCONF "writepid /var/run/$confighash{$cgiparams{'KEY'}}[1]n2n.pid\n";
- print CLIENTCONF "# Activate Management Interface and Port\n";
+ print CLIENTCONF "# Debug Level\n";
+ print CLIENTCONF "verb 3\n";
+ print CLIENTCONF "# Tunnel check\n";
+ print CLIENTCONF "keepalive 10 60\n";
+ print CLIENTCONF "# Start as daemon\n";
+ print CLIENTCONF "daemon $confighash{$cgiparams{'KEY'}}[1]n2n\n";
+ print CLIENTCONF "writepid /var/run/$confighash{$cgiparams{'KEY'}}[1]n2n.pid\n";
+ print CLIENTCONF "# Activate Management Interface and Port\n";
if ($confighash{$cgiparams{'KEY'}}[22] eq '') {print CLIENTCONF "management localhost $confighash{$cgiparams{'KEY'}}[29]\n"}
else {print CLIENTCONF "management localhost $confighash{$cgiparams{'KEY'}}[22]\n"};
print CLIENTCONF "# remsub $confighash{$cgiparams{'KEY'}}[11]\n";
-
+
close(CLIENTCONF);
-
+
$zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n";
my $status = $zip->writeToFileNamed($zippathname);
###
# m.a.d net2net
###
-
+
open(CLIENTCONF, ">$tempdir/$clientovpn") or die "Unable to open tempfile: $!";
flock CLIENTCONF, 2;
-
+
my $zip = Archive::Zip->new();
-
+
print CLIENTCONF "#OpenVPN Client conf\r\n";
print CLIENTCONF "tls-client\r\n";
print CLIENTCONF "client\r\n";
if ( $vpnsettings{'ENABLED'} eq 'on'){
print CLIENTCONF "remote $vpnsettings{'VPN_IP'} $vpnsettings{'DDEST_PORT'}\r\n";
- if ( $vpnsettings{'ENABLED_BLUE'} eq 'on' && (&haveBlueNet())){
- print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Blue interface\r\n";
+ if ( $vpnsettings{'ENABLED_BLUE'} eq 'on' && (&haveBlueNet())){
+ print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Blue interface\r\n";
print CLIENTCONF ";remote $netsettings{'BLUE_ADDRESS'} $vpnsettings{'DDEST_PORT'}\r\n";
}
if ( $vpnsettings{'ENABLED_ORANGE'} eq 'on' && (&haveOrangeNet())){
- print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Orange interface\r\n";
+ print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Orange interface\r\n";
print CLIENTCONF ";remote $netsettings{'ORANGE_ADDRESS'} $vpnsettings{'DDEST_PORT'}\r\n";
}
} elsif ( $vpnsettings{'ENABLED_BLUE'} eq 'on' && (&haveBlueNet())){
print CLIENTCONF "remote $netsettings{'BLUE_ADDRESS'} $vpnsettings{'DDEST_PORT'}\r\n";
if ( $vpnsettings{'ENABLED_ORANGE'} eq 'on' && (&haveOrangeNet())){
- print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Orange interface\r\n";
+ print CLIENTCONF "#Coment the above line and uncoment the next line, if you want to connect on the Orange interface\r\n";
print CLIENTCONF ";remote $netsettings{'ORANGE_ADDRESS'} $vpnsettings{'DDEST_PORT'}\r\n";
}
} elsif ( $vpnsettings{'ENABLED_ORANGE'} eq 'on' && (&haveOrangeNet())){
print CLIENTCONF "remote $netsettings{'ORANGE_ADDRESS'} $vpnsettings{'DDEST_PORT'}\r\n";
}
-
+
my $file_crt = new File::Temp( UNLINK => 1 );
my $file_key = new File::Temp( UNLINK => 1 );
my $include_certs = 0;
- if ($confighash{$cgiparams{'KEY'}}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12") {
+ if ($confighash{$cgiparams{'KEY'}}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12") {
if ($cgiparams{'MODE'} eq 'insecure') {
$include_certs = 1;
print CLIENTCONF "cert $confighash{$cgiparams{'KEY'}}[1]cert.pem\r\n";
print CLIENTCONF "key $confighash{$cgiparams{'KEY'}}[1].key\r\n";
$zip->addFile( "${General::swroot}/ovpn/ca/cacert.pem", "cacert.pem") or die "Can't add file cacert.pem\n";
- $zip->addFile( "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem", "$confighash{$cgiparams{'KEY'}}[1]cert.pem") or die "Can't add file $confighash{$cgiparams{'KEY'}}[1]cert.pem\n";
+ $zip->addFile( "${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem", "$confighash{$cgiparams{'KEY'}}[1]cert.pem") or die "Can't add file $confighash{$cgiparams{'KEY'}}[1]cert.pem\n";
}
print CLIENTCONF "cipher $vpnsettings{DCIPHER}\r\n";
print CLIENTCONF "auth $vpnsettings{'DAUTH'}\r\n";
close (LCC);
}
close(CLIENTCONF);
-
+
$zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n";
my $status = $zip->writeToFileNamed($zippathname);
print @fileholder;
exit (0);
}
-
-
-
+
+
+
###
### Remove connection
###
{
unlink "${General::swroot}/ovpn/ccd/$confighash{$cgiparams{'KEY'}}[2]";
}
-
+
&General::readhasharray("${General::swroot}/ovpn/ccdroute", \%ccdroutehash);
foreach my $key (keys %ccdroutehash) {
if ($ccdroutehash{$key}[0] eq $confighash{$cgiparams{'KEY'}}[1]){
}
}
&General::writehasharray("${General::swroot}/ovpn/ccdroute", \%ccdroutehash);
-
+
&General::readhasharray("${General::swroot}/ovpn/ccdroute2", \%ccdroute2hash);
foreach my $key (keys %ccdroute2hash) {
if ($ccdroute2hash{$key}[0] eq $confighash{$cgiparams{'KEY'}}[1]){
my $disabled;
&General::readhash("${General::swroot}/ovpn/settings", \%cgiparams);
read_routepushfile;
-
-
+
+
# if ($cgiparams{'CLIENT2CLIENT'} eq '') {
-# $cgiparams{'CLIENT2CLIENT'} = 'on';
+# $cgiparams{'CLIENT2CLIENT'} = 'on';
# }
ADV_ERROR:
if ($cgiparams{'MAX_CLIENTS'} eq '') {
$selected{'LOG_VERB'}{'10'} = '';
$selected{'LOG_VERB'}{'11'} = '';
$selected{'LOG_VERB'}{$cgiparams{'LOG_VERB'}} = 'SELECTED';
-
+
&Header::showhttpheaders();
&Header::openpage($Lang::tr{'status ovpn'}, 1, '');
- &Header::openbigbox('100%', 'LEFT', '', $errormessage);
+ &Header::openbigbox('100%', 'LEFT', '', $errormessage);
if ($errormessage) {
&Header::openbox('100%', 'LEFT', $Lang::tr{'error messages'});
print "<class name='base'>$errormessage\n";
</tr>
<tr>
<td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
- </tr>
- <tr>
+ </tr>
+ <tr>
<td class='base'>Domain</td>
<td><input type='TEXT' name='DHCP_DOMAIN' value='$cgiparams{'DHCP_DOMAIN'}' size='30' /></td>
</tr>
- <tr>
+ <tr>
<td class='base'>DNS</td>
<td><input type='TEXT' name='DHCP_DNS' value='$cgiparams{'DHCP_DNS'}' size='30' /></td>
- </tr>
- <tr>
+ </tr>
+ <tr>
<td class='base'>WINS</td>
<td><input type='TEXT' name='DHCP_WINS' value='$cgiparams{'DHCP_WINS'}' size='30' /></td>
</tr>
<tr>
<td colspan='4'><b>$Lang::tr{'ovpn routes push options'}</b></td>
</tr>
- <tr>
+ <tr>
<td class='base'>$Lang::tr{'ovpn routes push'}</td>
<td colspan='2'>
<textarea name='ROUTES_PUSH' cols='26' rows='6' wrap='off'>
<td> </td>
<td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'save-adv-options'}' disabled='disabled' /></td>
<td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'cancel-adv-options'}' /></td>
- <td> </td>
+ <td> </td>
</tr>
-</table>
+</table>
</form>
END
-;
-
-
+;
+
+
}else{
print<<END;
<td> </td>
<td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'save-adv-options'}' /></td>
<td allign='center'><input type='submit' name='ACTION' value='$Lang::tr{'cancel-adv-options'}' /></td>
- <td> </td>
+ <td> </td>
</tr>
-</table>
+</table>
</form>
END
-;
+;
}
&Header::closebox();
# print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>";
&Header::closebigbox();
&Header::closepage();
exit(0);
-
+
# A.Marx CCD Add,delete or edit CCD net
-} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'ccd net'} ||
- $cgiparams{'ACTION'} eq $Lang::tr{'ccd add'} ||
- $cgiparams{'ACTION'} eq "kill" ||
+} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'ccd net'} ||
+ $cgiparams{'ACTION'} eq $Lang::tr{'ccd add'} ||
+ $cgiparams{'ACTION'} eq "kill" ||
$cgiparams{'ACTION'} eq "edit" ||
$cgiparams{'ACTION'} eq 'editsave'){
&Header::showhttpheaders();
if ($cgiparams{'ACTION'} eq "kill"){
&delccdnet($cgiparams{'net'});
}
-
+
if ($cgiparams{'ACTION'} eq 'editsave'){
my ($a,$b) =split (/\|/,$cgiparams{'ccdname'});
if ( $a ne $b){ &modccdnet($a,$b);}
$cgiparams{'ccdname'}='';
$cgiparams{'ccdsubnet'}='';
}
-
+
if ($cgiparams{'ACTION'} eq $Lang::tr{'ccd add'}) {
&addccdnet($cgiparams{'ccdname'},$cgiparams{'ccdsubnet'});
}
&Header::openbox('100%', 'LEFT', $Lang::tr{'error messages'});
print "<class name='base'>$errormessage";
print " </class>";
- &Header::closebox();
+ &Header::closebox();
}
if ($cgiparams{'ACTION'} eq "edit"){
-
+
&Header::openbox('100%', 'LEFT', $Lang::tr{'ccd modify'});
print <<END;
<td colspan='4' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'ccd add'}' /><input type='submit' value='$Lang::tr{'add'}' /><input type='hidden' name='DOVPN_SUBNET' value='$cgiparams{'DOVPN_SUBNET'}'/></td></tr>
</table></form>
END
-
+
&Header::closebox();
}
&Header::openbox('100%', 'LEFT',$Lang::tr{'ccd net'} );
print "<b>$Lang::tr{'attention'}:</b><br>";
print "$Lang::tr{'ccd noaddnet'}<br><hr>";
}
-
+
print <<END;
<table width='100%' cellpadding='0' cellspacing='1'>
<tr>
END
;
}
- my %ccdconfhash=();
- &General::readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
+ my %ccdconfhash=();
+ &General::readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
my @ccdconf=();
my $count=0;
foreach my $key (sort { uc($ccdconfhash{$a}[0]) cmp uc($ccdconfhash{$b}[0]) } keys %ccdconfhash) {
<input type='image' src='/images/delete.gif' align='middle' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' /></form></td></tr>
END
;
- }
+ }
print "</table></form>";
&Header::closebox();
print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>";
&Header::closebigbox();
&Header::closepage();
exit(0);
-
+
#END CCD
###
#
# <td><b>$Lang::tr{'protocol'}</b></td>
-# protocol temp removed
+# protocol temp removed
print <<END;
<table width='100%' cellpadding='2' cellspacing='0' class='tbl'>
<tr>
{
chomp($line);
if ( $line =~ /^Updated,(.+)/){
- @match = split( /^Updated,(.+)/, $line);
+ @match = split( /^Updated,(.+)/, $line);
$status = $match[1];
}
-#gian
+#gian
if ( $line =~ /^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/) {
@match = split(m/^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $line);
if ($match[1] ne "Common Name") {
my $flag_icon = &Location::Functions::get_flag_icon($ccode);
$users[$uid]{'Country'} = "<a href='country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode' /></a>";
$uid++;
- }
+ }
}
if ( $line =~ /^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/) {
@match = split(m/^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/, $line);
print "<td align='left' $col>$users[$idx-1]{'LastRef'}</td>";
}
}
-
+
print "</table>";
print <<END;
<table width='100%' border='0' cellpadding='2' cellspacing='0'>
<tr><td align='center' >$Lang::tr{'the statistics were last updated at'} <b>$status</b></td></tr>
</table>
END
-;
+;
&Header::closebox();
print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>";
&Header::closebigbox();
###
} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
-
+
&General::readhash("${General::swroot}/ovpn/settings", \%vpnsettings);
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
<td class='base'>$Lang::tr{'host to net vpn'}</td></tr>
<tr><td><input type='radio' name='TYPE' value='net' /></td>
<td class='base'>$Lang::tr{'net to net vpn'}</td></tr>
- <tr><td><input type='radio' name='TYPE' value='net2net' /></td>
+ <tr><td><input type='radio' name='TYPE' value='net2net' /></td>
<td class='base'>$Lang::tr{'net to net vpn'} (Upload Client Package)</td></tr>
<tr><td> </td><td class='base'><input type='file' name='FH' size='30'></td></tr>
<tr><td> </td><td>Import Connection Name</td></tr>
</form></table>
END
;
-
+
} else {
print <<END;
my $uplp12name2 = '';
my @rem_subnet;
my @rem_subnet2;
- my @tmposupnet3;
+ my @tmposupnet3;
my $key;
my @n2nname;
- &General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
+ &General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
# Check if a file is uploaded
unless (ref ($cgiparams{'FH'})) {
my $zip = Archive::Zip->new();
my $zipName = $filename;
my $status = $zip->read( $zipName );
- if ($status != AZ_OK) {
+ if ($status != AZ_OK) {
$errormessage = "Read of $zipName failed\n";
goto N2N_ERROR;
}
}
if ( $_ =~ /.p12$/){
$uplp12name = $_;
- }
+ }
}
if (($uplconffilename eq '') || ($uplp12name eq '')){
$errormessage = "Either no *.conf or no *.p12 file found\n";
###
# m.a.d net2net
###
-
+
if ($cgiparams{'n2nname'} ne ''){
- $uplconffilename2 = "$cgiparams{'n2nname'}.conf";
- $uplp12name2 = "$cgiparams{'n2nname'}.p12";
+ $uplconffilename2 = "$cgiparams{'n2nname'}.conf";
+ $uplp12name2 = "$cgiparams{'n2nname'}.p12";
$n2nname[0] = $cgiparams{'n2nname'};
my @n2nname2 = split(/\./,$uplconffilename);
$n2nname2[0] =~ s/\n|\r//g;
$uplp12name2 = $uplp12name;
@n2nname = split(/\./,$uplconffilename);
$n2nname[0] =~ s/\n|\r//g;
- }
+ }
unless(-d "${General::swroot}/ovpn/n2nconf/"){mkdir "${General::swroot}/ovpn/n2nconf", 0755 or die "Unable to create dir $!";}
- unless(-d "${General::swroot}/ovpn/n2nconf/$n2nname[0]"){mkdir "${General::swroot}/ovpn/n2nconf/$n2nname[0]", 0770 or die "Unable to create dir $!";}
+ unless(-d "${General::swroot}/ovpn/n2nconf/$n2nname[0]"){mkdir "${General::swroot}/ovpn/n2nconf/$n2nname[0]", 0770 or die "Unable to create dir $!";}
#Add collectd settings to configfile
open(FILE, ">> $tempdir/$uplconffilename") or die 'Unable to open config file.';
unlink ($filename);
goto N2N_ERROR;
}
-
+
unless(move("$tempdir/$uplp12name", "${General::swroot}/ovpn/certs/$uplp12name2")) {
$errormessage = "$Lang::tr{'certificate file move failed'}: $!";
unlink ($filename);
}
chmod 0600, "${General::swroot}/ovpn/certs/$uplp12name";
-
+
my $complzoactive;
my $mssfixactive;
my $authactive;
my @n2nport = split(/ /, (grep { /^port/ } @firen2nconf)[0]);
my @n2ntunmtu = split(/ /, (grep { /^tun-mtu/ } @firen2nconf)[0]);
my @n2ncomplzo = grep { /^comp-lzo/ } @firen2nconf;
-if ($n2ncomplzo[0] =~ /comp-lzo/){$complzoactive = "on";} else {$complzoactive = "off";}
+if ($n2ncomplzo[0] =~ /comp-lzo/){$complzoactive = "on";} else {$complzoactive = "off";}
my @n2nmssfix = grep { /^mssfix/ } @firen2nconf;
if ($n2nmssfix[0] =~ /mssfix/){$mssfixactive = "on";} else {$mssfixactive = "off";}
#my @n2nmssfix = split(/ /, (grep { /^mssfix/ } @firen2nconf)[0]);
unlink ("${General::swroot}/ovpn/n2nconf/$n2nname[0]/$n2nname[0].conf") or die "Removing Configfile fail: $!";
unlink ("${General::swroot}/ovpn/certs/$n2nname[0].p12") or die "Removing Certfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$n2nname[0]") || die "Removing Directory fail: $!";
- goto N2N_ERROR;
+ goto N2N_ERROR;
}
}
unlink ("${General::swroot}/ovpn/n2nconf/$n2nname[0]/$n2nname[0].conf") or die "Removing Configfile fail: $!";
unlink ("${General::swroot}/ovpn/certs/$n2nname[0].p12") or die "Removing Certfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$n2nname[0]") || die "Removing Directory fail: $!";
- goto N2N_ERROR;
+ goto N2N_ERROR;
}
}
unlink ("${General::swroot}/ovpn/n2nconf/$n2nname[0]/$n2nname[0].conf") or die "Removing Configfile fail: $!";
unlink ("${General::swroot}/ovpn/certs/$n2nname[0].p12") or die "Removing Certfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$n2nname[0]") || die "Removing Directory fail: $!";
- goto N2N_ERROR;
+ goto N2N_ERROR;
}
}
-
-
-
+
+
+
$key = &General::findhasharraykey (\%confighash);
foreach my $i (0 .. 42) { $confighash{$key}[$i] = "";}
$confighash{$key}[0] = 'off';
$confighash{$key}[1] = $n2nname[0];
- $confighash{$key}[2] = $n2nname[0];
+ $confighash{$key}[2] = $n2nname[0];
$confighash{$key}[3] = 'net';
- $confighash{$key}[4] = 'cert';
- $confighash{$key}[6] = 'client';
+ $confighash{$key}[4] = 'cert';
+ $confighash{$key}[6] = 'client';
$confighash{$key}[8] = $n2nlocalsub[2];
$confighash{$key}[10] = $n2nremote[1];
- $confighash{$key}[11] = "$n2nremsub[1]/$n2nremsub[2]";
+ $confighash{$key}[11] = "$n2nremsub[1]/$n2nremsub[2]";
$confighash{$key}[22] = $n2nmgmt[2];
$confighash{$key}[23] = $mssfixactive;
$confighash{$key}[24] = $n2nfragment[1];
$confighash{$key}[41] = 'disabled';
&General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
-
+
N2N_ERROR:
-
+
&Header::showhttpheaders();
&Header::openpage('Validate imported configuration', 1, '');
&Header::openbigbox('100%', 'LEFT', '', $errormessage);
&Header::openbox('100%', 'LEFT', $Lang::tr{'error messages'});
print "<class name='base'>$errormessage";
print " </class>";
- &Header::closebox();
+ &Header::closebox();
- } else
- {
+ } else
+ {
&Header::openbox('100%', 'LEFT', 'import ipfire net2net config');
}
if ($errormessage eq ''){
<table width='100%'>
<tr><td width='25%'> </td><td width='25%'> </td></tr>
<tr><td class='boldbase'>$Lang::tr{'name'}:</td><td><b>$n2nname[0]</b></td></tr>
- <tr><td> </td><td> </td></tr>
- <tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'Act as'}</td><td><b>$confighash{$key}[6]</b></td></tr>
+ <tr><td> </td><td> </td></tr>
+ <tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'Act as'}</td><td><b>$confighash{$key}[6]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>Remote Host </td><td><b>$confighash{$key}[10]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'local subnet'}</td><td><b>$confighash{$key}[8]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'remote subnet'}:</td><td><b>$confighash{$key}[11]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>Management Port </td><td><b>$confighash{$key}[22]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'ovpn tls auth'}:</td><td><b>$confighash{$key}[39]</b></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'cipher'}</td><td><b>$confighash{$key}[40]</b></td></tr>
- <tr><td> </td><td> </td></tr>
+ <tr><td> </td><td> </td></tr>
</table>
END
-;
+;
&Header::closebox();
}
if ($errormessage) {
print "<div align='center'><a href='/cgi-bin/ovpnmain.cgi'>$Lang::tr{'back'}</a></div>";
- } else {
- print "<div align='center'><form method='post' ENCTYPE='multipart/form-data'><input type='submit' name='ACTION' value='$Lang::tr{'add'}' />";
+ } else {
+ print "<div align='center'><form method='post' ENCTYPE='multipart/form-data'><input type='submit' name='ACTION' value='$Lang::tr{'add'}' />";
print "<input type='hidden' name='TYPE' value='net2netakn' />";
- print "<input type='hidden' name='KEY' value='$key' />";
+ print "<input type='hidden' name='KEY' value='$key' />";
print "<input type='submit' name='ACTION' value='$Lang::tr{'cancel'}' /></div></form>";
- }
+ }
&Header::closebigbox();
&Header::closepage();
exit(0);
###
} elsif (($cgiparams{'ACTION'} eq $Lang::tr{'cancel'}) && ($cgiparams{'TYPE'} eq 'net2netakn')){
-
+
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
if ($confighash{$cgiparams{'KEY'}}) {
unlink ($conffile) or die "Removing $conffile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") || die "Kann Verzeichnis nicht loeschen: $!";
delete $confighash{$cgiparams{'KEY'}};
- &General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
+ &General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
} else {
$errormessage = $Lang::tr{'invalid key'};
- }
-
+ }
+
###
# m.a.d net2net
} elsif (($cgiparams{'ACTION'} eq $Lang::tr{'add'}) ||
($cgiparams{'ACTION'} eq $Lang::tr{'edit'}) ||
($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'ADVANCED'} eq '')) {
-
+
&General::readhash("${General::swroot}/ovpn/settings", \%vpnsettings);
&General::readhasharray("${General::swroot}/ovpn/caconfig", \%cahash);
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
$cgiparams{'TLSAUTH'} = $confighash{$cgiparams{'KEY'}}[41];
} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
$cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'});
-
+
#A.Marx CCD check iroute field and convert it to decimal
if ($cgiparams{'TYPE'} eq 'host') {
my @temp=();
my $val=0;
foreach $val (@temp){
chomp($val);
- $val=~s/\s*$//g;
+ $val=~s/\s*$//g;
#check if iroute exists in ccdroute or if new iroute is part of an existing one
foreach my $key (keys %ccdroutehash) {
foreach my $oldiroute ( 1 .. $#{$ccdroutehash{$key}}){
if (&General::IpInSubnet ($ip1,$ip2,$cidr2)){
$errormessage=$errormessage.$Lang::tr{'ccd err irouteexist'};
goto VPNCONF_ERROR;
- }
-
+ }
+
}
}
if (!&General::validipandmask($val)){
$ip=&General::getnetworkip($ip,&General::iporsubtocidr($cidr));
$cidr=&General::iporsubtodec($cidr);
$ccdroutehash{$keypoint}[$i] = $ip."/".$cidr;
-
+
}
-
+
#check for existing network IP's
if (&General::IpInSubnet ($ip,$netsettings{GREEN_NETADDRESS},$netsettings{GREEN_NETMASK}) && $netsettings{GREEN_NETADDRESS} ne '0.0.0.0')
{
$errormessage=$Lang::tr{'ccd err orange'};
goto VPNCONF_ERROR;
}
-
+
if (&General::validipandmask($val)){
$ccdroutehash{$keypoint}[$i] = $ip."/".$cidr;
}else{
&General::writehasharray("${General::swroot}/ovpn/ccdroute", \%ccdroutehash);
&writeserverconf;
}
- }
+ }
}
undef @temp;
#check route field and convert it to decimal
&General::readhash("${General::swroot}/ethernet/settings", \%ownnet);
foreach $val (@temp){
chomp($val);
- $val=~s/\s*$//g;
+ $val=~s/\s*$//g;
if ($val eq $Lang::tr{'green'})
{
$val=$ownnet{GREEN_NETADDRESS}."/".$ownnet{GREEN_NETMASK};
$val=$ownnet{ORANGE_NETADDRESS}."/".$ownnet{ORANGE_NETMASK};
}
my ($ip,$cidr) = split (/\//, $val);
-
+
if ($val ne $Lang::tr{'ccd none'})
- {
+ {
if (! &check_routes_push($val)){$errormessage=$errormessage."Route $val ".$Lang::tr{'ccd err routeovpn2'}." ($val)";goto VPNCONF_ERROR;}
if (! &check_ccdroute($val)){$errormessage=$errormessage."<br>Route $val ".$Lang::tr{'ccd err inuse'}." ($val)" ;goto VPNCONF_ERROR;}
if (! &check_ccdconf($val)){$errormessage=$errormessage."<br>Route $val ".$Lang::tr{'ccd err routeovpn'}." ($val)";goto VPNCONF_ERROR;}
$ccdroute2hash{$keypoint}[$i]='';
}
$i++;
- }
+ }
&General::writehasharray("${General::swroot}/ovpn/ccdroute2", \%ccdroute2hash);
#check dns1 ip
#CCD End
-
+
if ($cgiparams{'TYPE'} !~ /^(host|net)$/) {
$errormessage = $Lang::tr{'connection type is invalid'};
if ($cgiparams{'TYPE'} eq 'net') {
$errormessage = $Lang::tr{'openvpn destination port used'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- goto VPNCONF_ERROR;
+ goto VPNCONF_ERROR;
}
#Bugfix 10357
foreach my $key (sort keys %confighash){
$errormessage = $Lang::tr{'openvpn destination port used'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- goto VPNCONF_ERROR;
+ goto VPNCONF_ERROR;
}
}
if ($cgiparams{'DEST_PORT'} eq '') {
$errormessage = $Lang::tr{'invalid port'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- goto VPNCONF_ERROR;
+ goto VPNCONF_ERROR;
}
# Check if the input for the transfer net is valid.
$errormessage = $Lang::tr{'openvpn subnet is used'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- goto VPNCONF_ERROR;
+ goto VPNCONF_ERROR;
}
if (($cgiparams{'PROTOCOL'} eq 'tcp') && ($cgiparams{'MSSFIX'} eq 'on')) {
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
goto VPNCONF_ERROR;
}
-
+
if (($cgiparams{'PROTOCOL'} eq 'tcp') && ($cgiparams{'FRAGMENT'} ne '')) {
$errormessage = $Lang::tr{'openvpn fragment allowed with udp'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
goto VPNCONF_ERROR;
- }
-
+ }
+
if ( &validdotmask ($cgiparams{'OVPN_SUBNET'})) {
$errormessage = $Lang::tr{'openvpn prefix openvpn subnet'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
goto VPNCONF_ERROR;
- }
-
+ }
+
if ( &validdotmask ($cgiparams{'REMOTE_SUBNET'})) {
$errormessage = $Lang::tr{'openvpn prefix remote subnet'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
goto VPNCONF_ERROR;
}
-
+
if ($cgiparams{'DEST_PORT'} <= 1023) {
$errormessage = $Lang::tr{'ovpn port in root range'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
}
if ($cgiparams{'OVPN_MGMT'} eq '') {
- $cgiparams{'OVPN_MGMT'} = $cgiparams{'DEST_PORT'};
+ $cgiparams{'OVPN_MGMT'} = $cgiparams{'DEST_PORT'};
}
-
+
if ($cgiparams{'OVPN_MGMT'} <= 1023) {
$errormessage = $Lang::tr{'ovpn mgmt in root range'};
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
if ($cgiparams{'TYPE'} ne 'host') {
unless (&General::validipandmask($cgiparams{'LOCAL_SUBNET'})) {
- $errormessage = $Lang::tr{'local subnet is invalid'};
+ $errormessage = $Lang::tr{'local subnet is invalid'};
if ($cgiparams{'TYPE'} eq 'net') {
unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
# Check if there is no other entry without IP-address and PSK
if ($cgiparams{'REMOTE'} eq '') {
foreach my $key (keys %confighash) {
- if(($cgiparams{'KEY'} ne $key) &&
- ($confighash{$key}[4] eq 'psk' || $cgiparams{'AUTH'} eq 'psk') &&
+ if(($cgiparams{'KEY'} ne $key) &&
+ ($confighash{$key}[4] eq 'psk' || $cgiparams{'AUTH'} eq 'psk') &&
$confighash{$key}[10] eq '') {
$errormessage = $Lang::tr{'you can only define one roadwarrior connection when using pre-shared key authentication'};
goto VPNCONF_ERROR;
last;
}
}
-
+
$cgiparams{'CERT_NAME'} = $temp;
$cgiparams{'CERT_NAME'} =~ s/,//g;
$cgiparams{'CERT_NAME'} =~ s/\'//g;
$errormessage = $Lang::tr{'password too short'};
goto VPNCONF_ERROR;
}
- }
+ }
if ($cgiparams{'CERT_PASS1'} ne $cgiparams{'CERT_PASS2'}) {
$errormessage = $Lang::tr{'passwords do not match'};
goto VPNCONF_ERROR;
goto VPNCONF_ERROR;
}
}
-
+
# Sign the host certificate request
# The system call is safe, because all arguments are passed as an array.
system('/usr/bin/openssl', 'ca', '-days', "$cgiparams{'DAYS_VALID'}",
# Create the pkcs12 file
# The system call is safe, because all arguments are passed as an array.
- system('/usr/bin/openssl', 'pkcs12', '-export',
+ system('/usr/bin/openssl', 'pkcs12', '-export',
'-inkey', "${General::swroot}/ovpn/certs/$cgiparams{'NAME'}key.pem",
'-in', "${General::swroot}/ovpn/certs/$cgiparams{'NAME'}cert.pem",
'-name', $cgiparams{'NAME'},
'-passout', "pass:$cgiparams{'CERT_PASS1'}",
- '-certfile', "${General::swroot}/ovpn/ca/cacert.pem",
+ '-certfile', "${General::swroot}/ovpn/ca/cacert.pem",
'-caname', "$vpnsettings{'ROOTCERT_ORGANIZATION'} CA",
'-out', "${General::swroot}/ovpn/certs/$cgiparams{'NAME'}.p12");
if ($?) {
# Save the config
my $key = $cgiparams{'KEY'};
-
+
if (! $key) {
$key = &General::findhasharraykey (\%confighash);
foreach my $i (0 .. 43) { $confighash{$key}[$i] = "";}
if ((! $cgiparams{'KEY'}) && $cgiparams{'AUTH'} ne 'psk') {
$confighash{$key}[2] = $cgiparams{'CERT_NAME'};
}
-
+
$confighash{$key}[3] = $cgiparams{'TYPE'};
if ($cgiparams{'AUTH'} eq 'psk') {
$confighash{$key}[4] = 'psk';
$confighash{$key}[24] = $cgiparams{'FRAGMENT'};
$confighash{$key}[25] = $cgiparams{'REMARK'};
$confighash{$key}[26] = $cgiparams{'INTERFACE'};
-# new fields
+# new fields
$confighash{$key}[27] = $cgiparams{'OVPN_SUBNET'};
$confighash{$key}[28] = $cgiparams{'PROTOCOL'};
$confighash{$key}[29] = $cgiparams{'DEST_PORT'};
}
&General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
-
+
if ($cgiparams{'CHECK1'} ){
-
+
my ($ccdip,$ccdsub)=split "/",$cgiparams{$name};
my ($a,$b,$c,$d) = split (/\./,$ccdip);
if ( -e "${General::swroot}/ovpn/ccd/$confighash{$key}[2]"){
###
# m.a.d n2n begin
###
-
+
if ($cgiparams{'TYPE'} eq 'net') {
-
+
if (-e "/var/run/$confighash{$key}[1]n2n.pid") {
&General::system("/usr/local/bin/openvpnctrl", "-kn2n", "$confighash{$cgiparams{'KEY'}}[1]");
-
+
&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
my $key = $cgiparams{'KEY'};
if (! $key) {
$confighash{$key}[0] = 'on';
&General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
-
+
&General::system("/usr/local/bin/openvpnctrl", "-sn2n", "$confighash{$cgiparams{'KEY'}}[1]");
}
}
###
# m.a.d n2n end
-###
+###
if ($cgiparams{'EDIT_ADVANCED'} eq 'on') {
$cgiparams{'KEY'} = $key;
$cgiparams{'ENABLED'} = 'on';
###
# m.a.d n2n begin
-###
+###
$cgiparams{'MSSFIX'} = 'on';
$cgiparams{'FRAGMENT'} = '1300';
$cgiparams{'DAUTH'} = 'SHA512';
###
# m.a.d n2n end
-###
+###
$cgiparams{'SIDE'} = 'left';
if ( ! -f "${General::swroot}/ovpn/ca/cakey.pem" ) {
$cgiparams{'AUTH'} = 'psk';
$selected{'SIDE'}{'server'} = '';
$selected{'SIDE'}{'client'} = '';
$selected{'SIDE'}{$cgiparams{'SIDE'}} = 'SELECTED';
-
+
$selected{'PROTOCOL'}{'udp'} = '';
$selected{'PROTOCOL'}{'tcp'} = '';
$selected{'PROTOCOL'}{$cgiparams{'PROTOCOL'}} = 'SELECTED';
$checked{'AUTH'}{$cgiparams{'AUTH'}} = 'CHECKED';
$selected{'INTERFACE'}{$cgiparams{'INTERFACE'}} = 'SELECTED';
-
+
$checked{'COMPLZO'}{'off'} = '';
$checked{'COMPLZO'}{'on'} = '';
$checked{'COMPLZO'}{$cgiparams{'COMPLZO'}} = 'CHECKED';
print "<table width='100%' border='0'>\n";
print "<tr><td width='14%' class='boldbase'>$Lang::tr{'name'}: <img src='/blob.gif' alt='*' /></td>";
-
+
if ($cgiparams{'TYPE'} eq 'host') {
if ($cgiparams{'KEY'}) {
print "<td width='35%' class='base'><input type='hidden' name='NAME' value='$cgiparams{'NAME'}' />$cgiparams{'NAME'}</td>";
print <<END;
<td width='25%'> </td>
- <td width='25%'> </td></tr>
+ <td width='25%'> </td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'Act as'}</td>
<td><select name='SIDE'>
<option value='server' $selected{'SIDE'}{'server'}>$Lang::tr{'openvpn server'}</option>
<option value='udp' $selected{'PROTOCOL'}{'udp'}>UDP</option>
<option value='tcp' $selected{'PROTOCOL'}{'tcp'}>TCP</option></select></td>
</tr>
-
+
<tr>
<td class='boldbase'>$Lang::tr{'destination port'}: <img src='/blob.gif' alt='*' /></td>
<td><input type='TEXT' name='DEST_PORT' value='$cgiparams{'DEST_PORT'}' size='5' /></td>
</tr>
<tr><td colspan=4><hr /></td></tr><tr>
-
+
<tr>
<td class'base'><b>$Lang::tr{'MTU settings'}</b></td>
</tr>
#jumper
print "<tr><td class='boldbase'>$Lang::tr{'remark title'}</td>";
print "<td colspan='3'><input type='text' name='REMARK' value='$cgiparams{'REMARK'}' size='55' maxlength='50' /></td></tr></table>";
-
+
if ($cgiparams{'TYPE'} eq 'host') {
print "<tr><td>$Lang::tr{'enabled'} <input type='checkbox' name='ENABLED' $checked{'ENABLED'}{'on'} /></td>";
- }
+ }
print"</tr></table><br><br>";
-#A.Marx CCD new client
-if ($cgiparams{'TYPE'} eq 'host') {
+#A.Marx CCD new client
+if ($cgiparams{'TYPE'} eq 'host') {
print "<table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td colspan='3'><hr><br><b>$Lang::tr{'ccd choose net'}</td></tr><tr><td height='20' colspan='3'></td></tr>";
my %vpnnet=();
my $vpnip;
print"</td></tr></table><br><br>";
my $name=$cgiparams{'CHECK1'};
$checked{'RG'}{$cgiparams{'RG'}} = 'CHECKED';
-
- if (! -z "${General::swroot}/ovpn/ccd.conf"){
+
+ if (! -z "${General::swroot}/ovpn/ccd.conf"){
print"<table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='1%'></td><td width='30%' class='boldbase' align='center'><b>$Lang::tr{'ccd name'}</td><td width='15%' class='boldbase' align='center'><b>$Lang::tr{'network'}</td><td class='boldbase' align='center' width='18%'><b>$Lang::tr{'ccd clientip'}</td></tr>";
foreach my $key (sort { uc($ccdconfhash{$a}[0]) cmp uc($ccdconfhash{$b}[0]) } keys %ccdconfhash) {
$count++;
# ccd end
&Header::closebox();
if ($cgiparams{'KEY'} && $cgiparams{'AUTH'} eq 'psk') {
-
+
} elsif (! $cgiparams{'KEY'}) {
-
-
+
+
my $disabled='';
my $cakeydisabled='';
my $cacrtdisabled='';
if ( ! -f "${General::swroot}/ovpn/ca/cakey.pem" ) { $cakeydisabled = "disabled='disabled'" } else { $cakeydisabled = "" };
if ( ! -f "${General::swroot}/ovpn/ca/cacert.pem" ) { $cacrtdisabled = "disabled='disabled'" } else { $cacrtdisabled = "" };
-
+
&Header::openbox('100%', 'LEFT', $Lang::tr{'authentication'});
-
-
+
+
if ($cgiparams{'TYPE'} eq 'host') {
print <<END;
<table width='100%' cellpadding='0' cellspacing='5' border='0'>
-
+
<tr><td><input type='radio' name='AUTH' value='certreq' $checked{'AUTH'}{'certreq'} $cakeydisabled /></td><td class='base'>$Lang::tr{'upload a certificate request'}</td><td class='base' rowspan='2'><input type='file' name='FH' size='30' $cacrtdisabled></td></tr>
<tr><td><input type='radio' name='AUTH' value='certfile' $checked{'AUTH'}{'certfile'} $cacrtdisabled /></td><td class='base'>$Lang::tr{'upload a certificate'}</td></tr>
<tr><td colspan='3'> </td></tr>
print <<END;
<table width='100%' cellpadding='0' cellspacing='5' border='0'>
-
+
<tr><td><input type='radio' name='AUTH' value='certgen' $checked{'AUTH'}{'certgen'} $cakeydisabled /></td><td class='base'>$Lang::tr{'generate a certificate'}</td><td> </td></tr>
<tr><td> </td><td class='base'>$Lang::tr{'users fullname or system hostname'}: <img src='/blob.gif' alt='*' /></td><td class='base' nowrap='nowrap'><input type='text' name='CERT_NAME' value='$cgiparams{'CERT_NAME'}' SIZE='32' $cakeydisabled /></td></tr>
<tr><td> </td><td class='base'>$Lang::tr{'users email'}:</td><td class='base' nowrap='nowrap'><input type='text' name='CERT_EMAIL' value='$cgiparams{'CERT_EMAIL'}' SIZE='32' $cakeydisabled /></td></tr>
<tr><td> </td><td class='base'>$Lang::tr{'city'}:</td><td class='base' nowrap='nowrap'><input type='text' name='CERT_CITY' value='$cgiparams{'CERT_CITY'}' SIZE='32' $cakeydisabled /></td></tr>
<tr><td> </td><td class='base'>$Lang::tr{'state or province'}:</td><td class='base' nowrap='nowrap'><input type='text' name='CERT_STATE' value='$cgiparams{'CERT_STATE'}' SIZE='32' $cakeydisabled /></td></tr>
<tr><td> </td><td class='base'>$Lang::tr{'country'}:</td><td class='base'><select name='CERT_COUNTRY' $cakeydisabled>
-
-
+
+
END
;
<tr><td colspan='3'><hr /></td></tr>
<tr><td class='base' colspan='3' align='left'><img src='/blob.gif' alt='*' /> $Lang::tr{'required field'}</td></tr>
</table>
-
+
END
}
###
;
&Header::closebox();
-
+
}
-#A.Marx CCD new client
+#A.Marx CCD new client
if ($cgiparams{'TYPE'} eq 'host') {
print"<br><br>";
&Header::openbox('100%', 'LEFT', "$Lang::tr{'ccd client options'}:");
-
+
print <<END;
<table border='0' width='100%'>
<tr><td width='20%'>Redirect Gateway:</td><td colspan='3'><input type='checkbox' name='RG' $checked{'RG'}{'on'} /></td></tr>
<tr><td colspan='4'> </td></tr>
<tr><td valign='top'>$Lang::tr{'ccd iroute'}</td><td align='left' width='30%'><textarea name='IR' cols='26' rows='6' wrap='off'>
END
-
+
if ($cgiparams{'IR'} ne ''){
print $cgiparams{'IR'};
}else{
}
}
}
-
+
print <<END;
</textarea></td><td valign='top' colspan='2'>$Lang::tr{'ccd iroutehint'}</td></tr>
<tr><td colspan='4'><br></td></tr>
<tr><td valign='top' rowspan='3'>$Lang::tr{'ccd iroute2'}</td><td align='left' valign='top' rowspan='3'><select name='IFROUTE' style="width: 205px"; size='6' multiple>
END
-
+
my $set=0;
my $selorange=0;
my $selblue=0;
my $other=0;
my $none=0;
my @temp=();
-
+
our @current = ();
open(FILE, "${General::swroot}/main/routing") ;
@current = <FILE>;
close (FILE);
- &General::readhasharray ("${General::swroot}/ovpn/ccdroute2", \%ccdroute2hash);
+ &General::readhasharray ("${General::swroot}/ovpn/ccdroute2", \%ccdroute2hash);
#check for "none"
foreach my $key (keys %ccdroute2hash) {
if($ccdroute2hash{$key}[0] eq $cgiparams{'NAME'}){
}
#check if static routes are defined for client
foreach my $line (@current) {
- chomp($line);
+ chomp($line);
$line=~s/\s*$//g; # remove newline
@temp=split(/\,/,$line);
$temp[1] = '' unless defined $temp[1]; # not always populated
}
}
if ($set == '1' && $#temp != -1){ print"<option selected>$temp[1]</option>";$set=0;}elsif($set == '0' && $#temp != -1){print"<option>$temp[1]</option>";}
- }
+ }
my %vpnconfig = ();
&General::readhasharray("${General::swroot}/vpn/config", \%vpnconfig);
}
}
if (&haveBlueNet() && $selblue == '1'){ print"<option selected>$Lang::tr{'blue'}</option>";$selblue=0;}elsif(&haveBlueNet() && $selblue == '0'){print"<option>$Lang::tr{'blue'}</option>";}
- if (&haveOrangeNet() && $selorange == '1'){ print"<option selected>$Lang::tr{'orange'}</option>";$selorange=0;}elsif(&haveOrangeNet() && $selorange == '0'){print"<option>$Lang::tr{'orange'}</option>";}
+ if (&haveOrangeNet() && $selorange == '1'){ print"<option selected>$Lang::tr{'orange'}</option>";$selorange=0;}elsif(&haveOrangeNet() && $selorange == '0'){print"<option>$Lang::tr{'orange'}</option>";}
if ($selgreen == '1' || $other == '0'){ print"<option selected>$Lang::tr{'green'}</option>";$set=0;}else{print"<option>$Lang::tr{'green'}</option>";};
-
+
print<<END;
</select></td><td valign='top'>DNS1:</td><td valign='top'><input type='TEXT' name='CCD_DNS1' value='$cgiparams{'CCD_DNS1'}' size='30' /></td></tr>
<tr valign='top'><td>DNS2:</td><td><input type='TEXT' name='CCD_DNS2' value='$cgiparams{'CCD_DNS2'}' size='30' /></td></tr>
<tr valign='top'><td valign='top'>WINS:</td><td><input type='TEXT' name='CCD_WINS' value='$cgiparams{'CCD_WINS'}' size='30' /></td></tr></table><br><hr>
-
+
END
;
&Header::closebox();
}
}
}
-
+
#default setzen
if ($cgiparams{'DCIPHER'} eq '') {
$cgiparams{'DCIPHER'} = 'AES-256-CBC';
$activeonrun = "";
} else {
$activeonrun = "disabled='disabled'";
- }
- &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
+ }
+ &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
print <<END;
<table width='100%' border='0'>
<form method='post'>
print "<tr><td class='boldbase'>$Lang::tr{'ovpn on blue'}</td>";
print "<td><input type='checkbox' name='ENABLED_BLUE' $checked{'ENABLED_BLUE'}{'on'} /></td>";
}
- if (&haveOrangeNet()) {
+ if (&haveOrangeNet()) {
print "<tr><td class='boldbase'>$Lang::tr{'ovpn on orange'}</td>";
print "<td><input type='checkbox' name='ENABLED_ORANGE' $checked{'ENABLED_ORANGE'}{'on'} /></td>";
}
<td class='boldbase' nowrap='nowrap' colspan='2'>$Lang::tr{'ovpn subnet'}<br /><input type='TEXT' name='DOVPN_SUBNET' value='$cgiparams{'DOVPN_SUBNET'}' size='30' /></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'protocol'}</td>
<td><select name='DPROTOCOL'><option value='udp' $selected{'DPROTOCOL'}{'udp'}>UDP</option>
- <option value='tcp' $selected{'DPROTOCOL'}{'tcp'}>TCP</option></select></td>
+ <option value='tcp' $selected{'DPROTOCOL'}{'tcp'}>TCP</option></select></td>
<td class='boldbase'>$Lang::tr{'destination port'}:</td>
<td><input type='TEXT' name='DDEST_PORT' value='$cgiparams{'DDEST_PORT'}' size='5' /></td></tr>
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'MTU'} </td>
<tr><td colspan='4'><br><br></td></tr>
END
-;
-
+;
+
if ( $srunning eq "yes" ) {
print "<tr><td align='right' colspan='4'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' disabled='disabled' />";
print "<input type='submit' name='ACTION' value='$Lang::tr{'ccd net'}' />";
- print "<input type='submit' name='ACTION' value='$Lang::tr{'advanced server'}' />";
+ print "<input type='submit' name='ACTION' value='$Lang::tr{'advanced server'}' />";
print "<input type='submit' name='ACTION' value='$Lang::tr{'stop ovpn server'}' /></td></tr>";
} else{
print "<tr><td align='right' colspan='4'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' />";
-e "${General::swroot}/ovpn/ca/dh1024.pem" &&
-e "${General::swroot}/ovpn/certs/servercert.pem" &&
-e "${General::swroot}/ovpn/certs/serverkey.pem") &&
- (( $cgiparams{'ENABLED'} eq 'on') ||
+ (( $cgiparams{'ENABLED'} eq 'on') ||
( $cgiparams{'ENABLED_BLUE'} eq 'on') ||
( $cgiparams{'ENABLED_ORANGE'} eq 'on'))){
print "<input type='submit' name='ACTION' value='$Lang::tr{'start ovpn server'}' /></td></tr>";
} else {
- print "<input type='submit' name='ACTION' value='$Lang::tr{'start ovpn server'}' disabled='disabled' /></td></tr>";
- }
+ print "<input type='submit' name='ACTION' value='$Lang::tr{'start ovpn server'}' disabled='disabled' /></td></tr>";
+ }
}
print "</form></table>";
&Header::closebox();
my @output = "";
my @tustate = "";
my $tport = $confighash{$key}[22];
- my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport);
+ my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport);
if ($tport ne '') {
$tnet->open('127.0.0.1');
@output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
print <<END;
<td align='center' $col1>$active</td>
-
+
<form method='post' name='frm${key}a'><td align='center' $col>
<input type='image' name='$Lang::tr{'dl client arch'}' src='/images/openvpn.png' alt='$Lang::tr{'dl client arch'}' title='$Lang::tr{'dl client arch'}' border='0' />
<input type='hidden' name='ACTION' value='$Lang::tr{'dl client arch'}' />
; } else {
print "<td> </td>";
}
- if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") {
+ if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") {
print <<END;
<form method='post' name='frm${key}c'><td align='center' $col>
<input type='image' name='$Lang::tr{'download pkcs12 file'}' src='/images/media-floppy.png' alt='$Lang::tr{'download pkcs12 file'}' title='$Lang::tr{'download pkcs12 file'}' border='0' />
</tr>
</table>
</form>
-
+
<br><hr>
END
;
print ASNBLFILE<<END
TESTDATA = (10.0.0.1, 0) (127.0.0.1, 0) (fe80::1, 0)
-ACTIVE_ASNBLS =
+ACTIVE_ASNBLS =
END
;
&General::log($Lang::tr{'ssh is disabled'});
unlink "${General::swroot}/remote/enablessh";
}
-
+
if ($remotesettings{'SSH_PORT'} eq 'on')
{
&General::log("SSH Port 22");
{
&General::log("SSH Port 222");
}
-
+
if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} || $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ){
if ($remotesettings{'ENABLE_SSH'} eq 'off')
{
}
if ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart15'} ) { $counter = 900;}
elsif ( $remotesettings{'ACTION'} eq $Lang::tr{'ssh tempstart30'} ) { $counter = 1800;}
-
+
system("/usr/local/bin/sshctrl tempstart $counter >/dev/null");
}
else {
$settings{'GATEWAY'} = '';
$settings{'REMARK'} = '';
my @nosaved=('EN','IP','GATEWAY','REMARK'); # List here ALL setting2 fields. Mandatory
-
+
$settings{'ACTION'} = ''; # add/edit/remove
$settings{'KEY1'} = ''; # point record for ACTION
$temp[0] = $temp[0] ne '' ? '' : 'on'; # Toggle the field
@current[$settings{'KEY1'}] = join (',',@temp)."\n";
$settings{'KEY1'} = ''; # End edit mode
-
+
&General::log($Lang::tr{'routing config changed'});
#Save current
open(FILE, ">$datafile") or die 'routing datafile error';
print FILE @current;
close(FILE);
-
+
# Rebuild configuration file
&BuildConfiguration;
}
# Write changes to config file.
&SortDataFile; # sort newly added/modified entry
&BuildConfiguration; # then re-build routing
-
+
#map ($settings{$_}='' ,@nosaved); # Clear fields
}
}
}
if ($settings{'ACTION'} eq $Lang::tr{'remove'}) {
- splice (@current,$settings{'KEY1'},1); # Delete line
+ splice (@current,$settings{'KEY1'},1); # Delete line
open(FILE, ">$datafile") or die 'route datafile error';
print FILE @current;
close(FILE);
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
#Colorize each line
sub SortDataFile
{
our %entries = ();
-
+
# Sort pair of record received in $a $b special vars.
# When IP is specified use numeric sort else alpha.
# If sortname ends with 'Rev', do reverse sort.
# Build a pair 'Field Name',value for each of the data dataline.
# Each SORTABLE field must have is pair.
# Other data fields (non sortable) can be grouped in one
-
+
my @record = ('KEY',$key++,'EN',$temp[0],'IP',$temp[1],'GATEWAY',$temp[2],'REMARK',$temp[3]);
my $record = {}; # create a reference to empty hash
%{$record} = @record; # populate that hash with @record
$entries{$record->{KEY}} = $record; # add this to a hash of hashes
}
-
+
open(FILE, ">$datafile") or die 'routing datafile error';
# Each field value is printed , with the newline ! Don't forget separator and order of them.
}
&General::readhash("${General::swroot}/samba/settings", \%sambasettings);
-
+
if ($errormessage)
{
{
if (/^Name:\W+(.*)/)
{
- $testcmd = $1;
+ $testcmd = $1;
}
}
close FILE;
sub writeconfiguration() {
open (FILE, ">${General::swroot}/samba/global") or die "Can't save the global settings: $!";
flock (FILE, 2);
-
+
print FILE <<END;
# global.settings by IPFire Project
my $rxb_last = 0;
my $txb_last = 0;
-my (@fields, $field, $name, $value);
+my (@fields, $field, $name, $value);
@fields = split(/&/, $data_last);
foreach $field (@fields) {
($name, $value) = split(/=/, $field);
&Header::getcgihash(\%timesettings);
if ($timesettings{'ACTION'} eq $Lang::tr{'save'})
-{
+{
if ($timesettings{'ENABLENTP'} eq 'on')
{
if ( ! ( &General::validfqdn($timesettings{'NTP_ADDR_1'}) ||
} else {
unlink "${General::swroot}/time/allowclients";
}
-
+
}
else
{
$selected{'UPDATE_PERIOD'}{'monthly'} = '';
$selected{'UPDATE_PERIOD'}{$timesettings{'UPDATE_PERIOD'}} = "selected='selected'";
-# added to v0.0.4 to refresh screen if syncro event queued
+# added to v0.0.4 to refresh screen if syncro event queued
my $refresh = '';
if ( -e "/var/lock/time/settimenow") {
$refresh = "<meta http-equiv='refresh' content='60;' />";
my %vendorstats=();
my $repository = "/var/updatecache/";
-my $webhome = "/srv/web/ipfire/html";
+my $webhome = "/srv/web/ipfire/html";
my $hintcolour = '#FFFFCC';
my $colourgray = '#808080';
foreach $category (@categories) {
$blacklist = $category;
$category =~ s/\//_/g;
-
+
if ( $filtersettings{"FILTER_".uc($category)} ne "on" ){
my $constraintrule = "false";
-
+
foreach (@tclist){
chomp;
@tc = split(/\,/);
$constraintrule = "true";
}
}
-
+
if ( $constraintrule eq "false"){
next;
}
}
-
+
print FILE "dest $category {\n";
if (-e "$dbdir/$blacklist/domains") {
print FILE " domainlist $blacklist\/domains\n";
if ($status =~ /^(Vulnerable|Mitigation): (.*)$/) {
return ($1, $2);
- }
+ }
return $status;
}
unless( &General::validmac($cgiparams{'CLIENT_MAC'}) )
{
- $errormessage = $Lang::tr{'invalid mac address'};
+ $errormessage = $Lang::tr{'invalid mac address'};
goto ADDEXIT;
}
unless( &General::validmac($cgiparams{'CLIENT_MAC'}) )
{
- $errormessage = $Lang::tr{'invalid mac address'};
+ $errormessage = $Lang::tr{'invalid mac address'};
goto UPDATEEXIT;
}
;
print "<option value='green' $selected{'CLIENT_IFACE'}{'green'}>$Lang::tr{'green'}</option>";
-if (&haveBlueNet())
+if (&haveBlueNet())
{
print "<option value='blue' $selected{'CLIENT_IFACE'}{'blue'}>$Lang::tr{'blue'}</option>";
}
-if (&haveOrangeNet())
+if (&haveOrangeNet())
{
print "<option value='orange' $selected{'CLIENT_IFACE'}{'orange'}>$Lang::tr{'orange'}</option>";
}
END
;
-if ( ($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update') )
+if ( ($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update') )
{
print "<input type='hidden' name='ID' value='$cgiparams{'ID'}' />\n";
print "<input type='hidden' name='ACTION' value='update' />";
my $wol_iface = $wol_devices[$i]{'IFace'};
my $wol_txt = &Header::cleanhtml($wol_devices[$i]{'Comment'});
- if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) )
+ if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) )
{
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";
}
- elsif ( $i % 2)
+ elsif ( $i % 2)
{
print "<tr>";
$col="bgcolor='$color{'color20'}'";
<td align='center' $col>
END
;
- if ( (($wol_iface eq 'blue') && ! &haveBlueNet())
+ if ( (($wol_iface eq 'blue') && ! &haveBlueNet())
|| (($wol_iface eq 'orange') && ! &haveOrangeNet()) )
{
# configured IFace (momentarily) not available -> now wakeup button/image
{
# datafileformat:
# ID,MAC,IFACE,,Comment
- #
+ #
my @tmpfile = ();
if ( open(FILE, "$datafile") )
{
unless(&General::validmac($wol_devices[$i]{'MAC'})) { next; }
unshift (@tmp_clients, uc($wol_devices[$i]{'MAC'}).",$wol_devices[$i]{'IFace'},,$wol_devices[$i]{'Comment'}");
}
-
+
# sort tmp_clients on MAC
@tmp_clients = sort ( @tmp_clients );
open(FILE, ">$datafile") or die 'hosts datafile error';
my $count = 0;
- foreach $line (@tmp_clients)
+ foreach $line (@tmp_clients)
{
print FILE "$count,$line\n";
$count++;
if (($cgiparams{'ACTION'} eq 'submit') && ($is_supervisor))
{
- if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) ||
+ if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) ||
((defined($proxysettings{'SUPERVISOR_PASSWORD'})) && ($proxysettings{'SUPERVISOR_PASSWORD'} eq '')))
{
&write_acl;
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
-
+
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;
my $errormessage = '';
my $filename = "${General::swroot}/wireless/config";
my $hostsfile = "${General::swroot}/main/hosts";
-our %dhcpsettings=();
+our %dhcpsettings=();
our %netsettings=();
$cgiparams{'ENABLED'} = 'off';
{
$cgiparams{'SOURCE_IP'} = 'NONE';
} else {
- unless(&General::validipormask($cgiparams{'SOURCE_IP'}))
+ unless(&General::validipormask($cgiparams{'SOURCE_IP'}))
{
- $errormessage = $Lang::tr{'invalid fixed ip address'};
+ $errormessage = $Lang::tr{'invalid fixed ip address'};
goto ADDERROR;
}
}
{
$cgiparams{'SOURCE_MAC'} = 'NONE';
} else {
- unless(&General::validmac($cgiparams{'SOURCE_MAC'}))
- {
- $errormessage = $Lang::tr{'invalid fixed mac address'};
+ unless(&General::validmac($cgiparams{'SOURCE_MAC'}))
+ {
+ $errormessage = $Lang::tr{'invalid fixed mac address'};
}
}
}
if ( $hname eq "" ) {
my ($aliases, $addrtype, $length, @addrs);
- ($hname, $aliases, $addrtype, $length, @addrs) =
+ ($hname, $aliases, $addrtype, $length, @addrs) =
gethostbyaddr(pack("C4", split(/\./, $sourceip)), 2);
}
}
$gdesc = $Lang::tr{'click to disable'};
} else {
$gif = 'off.gif';
- $gdesc = $Lang::tr{'click to enable'};
+ $gdesc = $Lang::tr{'click to enable'};
}
# Colorize each line
<br>
<hr>
-
+
<strong>
$Lang::tr{'wlan client advanced settings'}:
</strong>
#zoneconf td.heading {
background-color: lightgrey;
color: white;
- }
+ }
#zoneconf td.heading.bold::first-line {
font-weight: bold;
line-height: 1.6;
}
$VALIDATE_nic_check{"VLAN $mac $vlan_tag"} = 1;
-
+
# check VLAN tag range: 1..4094 (0, 4095 are reserved)
unless (looks_like_number($vlan_tag) && ($vlan_tag >= 1) && ($vlan_tag <= 4094)) {
$VALIDATE_error = $Lang::tr{"zoneconf val vlan tag range error"};
if ($access_selected{"NONE"} eq "") {
$highlight = $_;
}
-
+
print <<END
<td class="$highlight">
<select name="ACCESS $uc $mac" data-zone="$uc" data-mac="$mac" onchange="highlightAccess(this)">
my $stp_available = $ethsettings{"${uc}_MODE"} eq "bridge"; # STP is only available in bridge mode
my $stp_enabled = $ethsettings{"${uc}_STP"} eq "on";
my $stp_priority = $ethsettings{"${uc}_STP_PRIORITY"};
-
+
# set priority to default value if no numerical value is configured
$stp_priority = 32768 unless looks_like_number($stp_priority);
// Get selected time range from button
const range = buttonObj.dataset.range;
-
- // Get surrounding div box and select new range
+
+ // Get surrounding div box and select new range
let graphBox = $(buttonObj).closest('div');
_rrdimg_setRange(graphBox, range);
}
// Check if the time range is changed
if((graphBox.data('range') !== range) || initMode) {
graphBox.data('range', range); //Store new range
-
+
// Update button highlighting
graphBox.find('button').removeClass('selected');
graphBox.find(`button[data-range="${range}"]`).addClass('selected');
// graphBox: jQuery object (graph element must be valid)
function _rrdimg_reload(graphBox) {
const origin = graphBox.data('origin');
- const graph = graphBox.data('graph');
+ const graph = graphBox.data('graph');
const timestamp = Date.now();
// Get user selected range or fall back to default
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ACCESS MESSAGE</title>
<style content="text/css">
td.image {
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;
# @param submenu entries
sub showsubmenu() {
my $submenus = shift;
-
+
print "<ul>";
foreach my $item (sort keys %$submenus) {
$link = getlink($submenus->{$item});
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
# Common Macro Definitions
###############################################################################
-# For each package we create a list of files that it installed under
+# For each package we create a list of files that it installed under
# log/<TARGET> name. Modified files are not identified
#
define FIND_FILES
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
# Install initscript
$(call INSTALL_INITSCRIPTS,$(SERVICES))
-
+
#install backup definition
install -v -m 644 ${DIR_SRC}/config/backup/includes/avahi \
/var/ipfire/backup/addons/includes/avahi
-
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
download :
-md5 :
+md5 :
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
--with-lib-path=$(TOOLS_DIR)/lib \
--disable-nls
EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_INSTALL =
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools2
EXTRA_ENV = \
--with-lib-path=$(TOOLS_DIR)/lib \
--with-sysroot \
--disable-nls
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
endif
endif
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
download :
-md5 :
+md5 :
###############################################################################
# Installation Details
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
-download :
+download :
-md5 :
+md5 :
###############################################################################
# Installation Details
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = Antivirus Toolkit
+SUMMARY = Antivirus Toolkit
VER = 0.104.2
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
# Top-level Rules
###############################################################################
-objects =
+objects =
install : $(TARGET)
-check :
+check :
download :
mv /etc/collectd.vpn /var/ipfire/ovpn/collectd.vpn
chown nobody.nobody /var/ipfire/ovpn/collectd.vpn
ln -f -s ../var/ipfire/ovpn/collectd.vpn /etc/collectd.vpn
- ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd
+ ln -f -s ../init.d/collectd /etc/rc.d/rc0.d/K50collectd
ln -f -s ../init.d/collectd /etc/rc.d/rc3.d/S29collectd
- ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd
+ ln -f -s ../init.d/collectd /etc/rc.d/rc6.d/K50collectd
@rm -rf $(DIR_APP)
@$(POSTBUILD)
#remove excluded files from ROOTFILES
grep -f $(DIR_SRC)/config/rootfiles/$@/exclude -v /tmp/ROOTFILES.tmp > /tmp/ROOTFILES
rm -rf /tmp/ROOTFILES.tmp
-
+
#Change KVER to Kernelversion
sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES
include Config
-SUMMARY = Tools to Determine and Set CPUfreq Settings
+SUMMARY = Tools to Determine and Set CPUfreq Settings
VER = 008
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = Data Copying in the Presence of I/O Errors
+SUMMARY = Data Copying in the Presence of I/O Errors
VER = 1.25
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = Higher-level library to access ELF files
+SUMMARY = Higher-level library to access ELF files
VER = 0.186
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
-download :
+download :
-md5 :
+md5 :
###############################################################################
# Installation Details
#Create Placeholder files
echo "Place scripts run minutely here ..." > /etc/fcron.minutely/info.txt
- echo "Place scripts run cyclic here ..." > /etc/fcron.cyclic/info.txt
+ echo "Place scripts run cyclic here ..." > /etc/fcron.cyclic/info.txt
echo "Place scripts run hourly here ..." > /etc/fcron.hourly/info.txt
echo "Place scripts run daily here ..." > /etc/fcron.daily/info.txt
echo "Place scripts run weekly here ..." > /etc/fcron.weekly/info.txt
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
ifeq "$(ROOT)" ""
TARGET = $(DIR_INFO)/$(THISAPP)
EXTRA_CONFIG = --prefix=/usr --disable-nls
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
--without-ppl \
--without-cloog \
--enable-languages=c,c++
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
else
ifeq "$(PASS)" "2"
TARGET = $(DIR_INFO)/$(THISAPP)-tools2
--disable-libstdcxx-pch \
--disable-multilib \
--disable-libgomp
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
ifeq "$(FULL_BOOTSTRAP)" "1"
EXTRA_CONFIG += --enable-bootstrap
--disable-libstdcxx-threads \
--disable-libstdcxx-pch \
--with-gxx-include-dir=$(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER)
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
endif
endif
endif
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
PROG = gptfdisk
PAK_VER = 1
-DEPS =
+DEPS =
###############################################################################
# Top-level Rules
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = Printer drivers for CUPS from the Gutenprint project
+SUMMARY = Printer drivers for CUPS from the Gutenprint project
VER = 5.2.9
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = The Reliable, High Performance TCP/HTTP Load Balancer
+SUMMARY = The Reliable, High Performance TCP/HTTP Load Balancer
VER = 2.2.4
include Config
-SUMMARY = HP's Printing, Scanning, and Faxing Software
+SUMMARY = HP's Printing, Scanning, and Faxing Software
VER = 3.21.6
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
include Config
-SUMMARY = An Interactive text-mode Process Viewer for Linux
+SUMMARY = An Interactive text-mode Process Viewer for Linux
VER = 3.1.2
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && ./configure --prefix=/usr
+ cd $(DIR_APP) && ./configure --prefix=/usr
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
PROG = lcdproc
PAK_VER = 2
-DEPS =
+DEPS =
SERVICES = lcdproc
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
PAK_VER = 2
-DEPS =
+DEPS =
SERVICES =
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist :
+dist :
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
# Blacklist new drm framebuffer modules
for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm -name *.ko.xz); do \
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer.conf ; \
- done
+ done
sed -i -e "s|.ko.xz||g" /etc/modprobe.d/framebuffer.conf
# Disable ipv6 at runtime
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
@cd $(DIR_APP) && chmod 755 install_logwatch.sh
cd $(DIR_APP) && yes "" | ./install_logwatch.sh
-
+
#sed -i 's/^Print = .*$$/Print = Yes/' /etc/log.d/conf/logwatch.conf
# comment out line with unused example
#sed -i '/-zz-network/s/Service/#Service/' /etc/log.d/conf/logwatch.conf
# done
cp -f $(DIR_SRC)/config/logwatch/dialup /usr/share/logwatch/scripts/services/dialup
cp -f $(DIR_SRC)/config/logwatch/dialup.conf /usr/share/logwatch/dist.conf/services/dialup.conf
-
+
-mkdir -p /var/cache/logwatch
chmod -v 777 /var/cache/logwatch
-mkdir -p /var/log/logwatch
include Config
-SUMMARY = HardWare LiSter
+SUMMARY = HardWare LiSter
VER = B.02.19.2
PROG = lshw
PAK_VER = 1
-DEPS =
+DEPS =
SERVICES =
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
#install initscripts
$(call INSTALL_INITSCRIPTS,$(SERVICES))
-
+
#install backup definition
install -v -m 644 ${DIR_SRC}/config/backup/includes/minidlna \
/var/ipfire/backup/addons/includes/minidlna
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
include Config
-SUMMARY = Music Player Daemon
+SUMMARY = Music Player Daemon
VER = 0.22.6
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
download :
-md5 :
+md5 :
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ncat-7.91-fix-a-unix-domain-socket-crash.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ncat-7.91-fix-a-unix-domain-socket-crash.patch
$(UPDATE_AUTOMAKE)
cd $(DIR_APP) && mkdir -p build
cd $(DIR_APP) && ./configure \
PROG = ncdu
PAK_VER = 2
-DEPS =
+DEPS =
SERVICES =
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
cd $(DIR_APP) && python3 configure.py --bootstrap --verbose
# Build ninja
- cd $(DIR_APP) && ./ninja -v all
+ cd $(DIR_APP) && ./ninja -v all
# Install ninja.
cd $(DIR_APP) && install -vm755 ninja /usr/bin/
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
dist:
- @$(PAK)
+ @$(PAK)
###############################################################################
# Downloading, checking, md5sum
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-
+
$(subst %,%_MD5,$(objects)) :
@$(MD5)
install : $(TARGET)
-check :
+check :
-download :
+download :
-md5 :
+md5 :
###############################################################################
# Installation Details
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
dist :
@$(PAK)
-
+
###############################################################################
# Downloading, checking, md5sum
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh Archive-Tar $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh Archive-Zip $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh BerkeleyDB $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh Convert-TNEF $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh Convert-UUlib $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh IO-Stringy $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-#dist:
+#dist:
# make-packages.sh Net-Server $(THISAPP)-ipfire-beta-1
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
download :
-md5 :
+md5 :
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
PROG = qemu-ga
PAK_VER = 1
-DEPS =
+DEPS =
SERVICES = qemu-ga
install : $(TARGET)
-download :
+download :
-md5 :
+md5 :
-dist:
+dist:
@$(PAK)
###############################################################################
# Installation Details
###############################################################################
-$(TARGET) :
+$(TARGET) :
@$(PREBUILD)
#install initscripts
include Config
-SUMMARY = Transport independent RPC portmapper
+SUMMARY = Transport independent RPC portmapper
VER = 1.2.6
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools
EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls
- EXTRA_MAKE =
- EXTRA_INSTALL =
+ EXTRA_MAKE =
+ EXTRA_INSTALL =
endif
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
PROG = socat
PAK_VER = 2
-DEPS =
+DEPS =
SERVICES =
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
chmod 775 /var/updatecache/metadata
chmod 755 /var/log/updatexlrator
chmod 755 /srv/web/ipfire/html/images/updbooster
-
+
chown squid:squid /var/log/squid
ln -sf /usr/lib/squid /usr/lib/squid/auth
cp -f $(DIR_SRC)/config/proxy/proxy.pac /srv/web/ipfire/html/proxy.pac
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
+objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
cp -f $(DIR_CONF)/urlfilter/autoupdate.pl /var/ipfire/urlfilter/bin/autoupdate.pl
chmod 755 /var/ipfire/urlfilter/bin/autoupdate.pl
echo "1.5-beta" > /var/ipfire/urlfilter/version
-
+
# Wrapper
cp -f $(DIR_CONF)/urlfilter/redirect_wrapper /usr/sbin
chmod 755 /usr/sbin/redirect_wrapper
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
mv -vf /usr/local/bin/ovpn-ccd-convert /usr/sbin/
mv -vf /usr/local/bin/ovpn-collectd-convert /usr/sbin/
mv -vf /usr/local/bin/captive-cleanup /usr/bin/
-
+
# Install firewall scripts.
mkdir -pv /usr/lib/firewall
install -m 755 $(DIR_SRC)/config/firewall/rules.pl \
# Permissions
chmod 0711 /var/empty
-
+
# A small hack to include /root to the iso but not all of it's files.
touch /root/ipfire
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
cd $(DIR_APP) && sed -i src/mountpoint.c src/bootlogd.c \
-e "/include.*sys\/stat.h/a#include <sys/sysmacros.h>\n"
cd $(DIR_APP) && sed -e "s/libcrypt.a/libcrypt.so/g" -i src/Makefile
- cd $(DIR_APP) && make $(MAKETUNING) -C src
+ cd $(DIR_APP) && make $(MAKETUNING) -C src
cd $(DIR_APP) && make -C src install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/telnet-0.17-errno_test_sys_bsd.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/netkit-telnet-0.17-reallynodns.patch
cd $(DIR_APP) && ./configure --prefix=/usr
- cd $(DIR_APP) && make
+ cd $(DIR_APP) && make
cd $(DIR_APP) && make install
rm -f /usr/sbin/telnetd
rm -f /usr/man/man8/in.telnetd.8
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-ipfire.patch
- cd $(DIR_APP) && make
+ cd $(DIR_APP) && make
cd $(DIR_APP) && make install prefix=/usr bindir=/usr/sbin
chmod u-s /usr/sbin/traceroute
@rm -rf $(DIR_APP)
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist :
+dist :
@$(PAK)
###############################################################################
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
endif
# create an empty 128 KB File for the u-boot env
dd if=/dev/zero of=/boot/uboot.env bs=1K count=128
-
+
# config (uEnv.txt and boot.*)
cp -vf $(DIR_SRC)/config/u-boot/* /boot/
# patch real Kernel version to uEnv.txt
$(subst %,%_MD5,$(objects)) :
@$(MD5)
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
#install initscripts
$(call INSTALL_INITSCRIPTS,$(SERVICES))
install -v -m 644 $(DIR_SRC)/config/backup/includes/watchdog \
- /var/ipfire/backup/addons/includes/watchdog
+ /var/ipfire/backup/addons/includes/watchdog
@rm -rf $(DIR_APP)
@$(POSTBUILD)
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install: $(TARGET)
-check:
+check:
download:
-md5:
+md5:
###############################################################################
# Installation Details
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
install : $(TARGET)
-check :
+check :
download :
-md5 :
+md5 :
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
md5 : $(subst %,%_MD5,$(objects))
-dist:
+dist:
@$(PAK)
###############################################################################
Modified feb 2001 by Stephen Aaskov (saa@lasat.com)
- Added daemonization code
- Added syslog
-
+
TODO: Delete interfaces after exit?
*/
void exitFunc(void)
{
- syslog (LOG_PID,"Daemon terminated\n");
+ syslog (LOG_PID,"Daemon terminated\n");
}
int create_br(char *nstr)
{
int num, err;
-
+
if(lastsock<0) {
lastsock = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5);
}
ni.mtu = 1500;
sprintf(ni.ifname, "nas%d", num);
err=ioctl (lastsock, ATM_NEWBACKENDIF, &ni);
-
+
if (err == 0)
syslog(LOG_INFO, "Interface \"%s\" created sucessfully\n",ni.ifname);
else
err=text2atm(astr,(struct sockaddr *)(&addr), sizeof(addr), T2A_PVC);
if (err!=0)
syslog(LOG_ERR,"Could not parse ATM parameters (error=%d)\n",err);
-
+
#if 0
addr.sap_family = AF_ATMPVC;
addr.sap_addr.itf = itf;
addr.sap_addr.vpi,
addr.sap_addr.vci,
encap?"VC mux":"LLC");
-
+
if ((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0)
syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno));
-
+
if (qos.aal == 0) {
qos.aal = ATM_AAL5;
qos.txtp.traffic_class = ATM_UBR;
if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) )
syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err));
-
+
if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0)
syslog(LOG_ERR,"setsockopt SO_ATMQOS %d", errno);
err = connect(fd, (struct sockaddr*)&addr, sizeof(struct sockaddr_atmpvc));
-
+
if (err < 0)
fatal("failed to connect on socket", err);
-
+
/* attach the vcc to device: */
-
+
be.backend_num = ATM_BACKEND_BR2684;
be.ifspec.method = BR2684_FIND_BYIFNAME;
sprintf(be.ifspec.spec.ifname, "nas%d", lastitf);
int itfnum;
lastsock=-1;
lastitf=0;
-
+
/* st qos to 0 */
memset(&reqqos, 0, sizeof(reqqos));
switch (c) {
case 'q':
printf ("optarg : %s",optarg);
- if (text2qos(optarg,&reqqos,0)) fprintf(stderr,"QOS parameter invalid\n");
+ if (text2qos(optarg,&reqqos,0)) fprintf(stderr,"QOS parameter invalid\n");
break;
case 'a':
assign_vcc(optarg, encap, sndbuf, reqqos);
usage(argv[0]);
if (argc != optind) usage(argv[0]);
-
+
if(lastsock>=0) close(lastsock);
-
+
if (background) {
pid_t pid;
-
+
pid=fork();
if (pid < 0) {
fprintf(stderr,"Error detaching\n");
exit(2);
- } else if (pid)
+ } else if (pid)
exit(0); // This is the parent
-
+
// Become a process group and session group leader
if (setsid()<0) {
fprintf (stderr,"Could not set process group\n");
exit(2);
}
-
+
// Fork again to let process group leader exit
pid = fork();
if (pid < 0) {
exit(2);
} else if (pid)
exit(0); // This is the parent
-
+
// Now we're ready for buisness
chdir("/"); // Don't keep directories in use
close(0); close(1); close(2); // Close stdin, -out and -error
/*
- Note that this implementation does not keep an open
+ Note that this implementation does not keep an open
stdout/err.
If we need them they can be opened now
*/
-
+
}
-
+
create_pidfile(itfnum);
- syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n");
+ syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n");
atexit (exitFunc);
-
+
while (1) sleep(30); /* to keep the sockets... */
return 0;
}
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/sh
-########################################################################
-# Begin
-#
-# Description : ANY Device Script
-#
-# Authors : Nathan Coulson - nathan@linuxfromscratch.org
-# Kevin P. Fleming - kpfleming@linuxfromscratch.org
-# Michael Tremer - mitch@ipfire.org
-# Maniacikarus - maniacikarus@ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
-. /etc/sysconfig/rc
+. /etc/sysconfig/rc
. ${rc_functions}
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
start)
boot_mesg "Bringing up the ${DEVICE} interface..."
boot_mesg_flush
-
+
# Check if an interface is there...
if ip link show ${DEVICE} > /dev/null 2>&1; then
link_status=`ip link show ${DEVICE} 2> /dev/null`
# Create & Enable vnstat data collection
/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
-
+
if [ ! "${ADDRESS}" == "1.1.1.1" ]; then
boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
ip addr add ${args} dev ${DEVICE}
exit 0;
;;
esac
-# End
-########################################################################
-# Begin
-#
-# Description : DHCP Client Script
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 02.10
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
#!/bin/sh
-#
-########################################################################
-# Begin
-#
-# Description : A collection of functions for the IPFire network scripts
-#
-# Authors : IPFire Development Team <developers@ipfire.org>
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
-
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
eval $(/usr/local/bin/readhash /var/ipfire/dns/settings)
#!/bin/sh
-########################################################################
-# Begin
-#
-# Description : RED Device Script
-#
-# Authors : Michael Tremer - mitch@ipfire.org
-# Maniacikarus - maniacikarus@ipfire.org
-# Inspired by : Nathan Coulson - nathan@linuxfromscratch.org
-# Kevin P. Fleming - kpfleming@linuxfromscratch.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
-
-. /etc/sysconfig/rc
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+. /etc/sysconfig/rc
. ${rc_functions}
. /etc/init.d/networking/functions.network
[ "${1}" == "start" ] && exit 0
fi
fi
-
+
if [ "${TYPE}" == "STATIC" ]; then
if [ "${DEVICE}" != "${GREEN_DEV}" ]; then
ADDRESS="${RED_ADDRESS}"
if [ -n "${link_status}" ]; then
if ! echo "${link_status}" | grep -q UP; then
if [ -n "$MAC" ]; then
- boot_mesg "Setting mac address on ${DEVICE} to ${MAC}"
+ boot_mesg "Setting mac address on ${DEVICE} to ${MAC}"
ip link set dev ${DEVICE} address ${MAC}
evaluate_retval
fi
## Create & Enable vnstat
/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
-
+
if [ "${TYPE}" == "STATIC" ]; then
# Set the MTU
if [ -n "${MTU}" ]; then
echo "$GATEWAY gateway" >> /tmp/hosts
mv /tmp/hosts /etc/hosts
touch /var/ipfire/red/active
-
+
# Create route to default gateway
ip route add ${GATEWAY} dev ${DEVICE}
boot_mesg "Setting up default gateway ${GATEWAY}..."
ip route add default via ${GATEWAY} dev ${DEVICE}
evaluate_retval
-
+
if [ -d "/sys/class/net/${DEVICE}" ]; then
# has carrier ?
if [ ! "$(</sys/class/net/${DEVICE}/carrier)" = "1" ]; then
echo_failure
exit 1
fi
-
+
eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
-
+
[ -c "/dev/ppp" ] || mknod /dev/ppp c 108 0
# We force the plugin method, anyway.
PPP_NIC=${DEVICE}
-
if [ "$TYPE" == "pppoeatm" ] || [ "$TYPE" == "pptpatm" ]; then
PPP_NIC=nas${ATM_DEV}
DEVICE=nas${ATM_DEV}
modprobe 8021q
vconfig add ${DEVICE} ${IPTV_VLAN}
if [ -n "$MAC2" ]; then
- boot_mesg "Setting mac address on ${DEVICE}.${IPTV_VLAN} to ${MAC2}"
+ boot_mesg "Setting mac address on ${DEVICE}.${IPTV_VLAN} to ${MAC2}"
ip link set dev ${DEVICE}.${IPTV_VLAN} address ${MAC2}
evaluate_retval
fi
else
boot_mesg "Bringing up the PPP via ${TYPE} on ${COMPORT}..."
fi
-
+
### ###
### Configuring the pppd ###
### ###
-
+
### Plugin Options
- #
+ #
if [ "$TYPE" == "pppoe" ]; then
[ "${METHOD}" == "PPPOE_PLUGIN" ] && \
PLUGOPTS="plugin rp-pppoe.so"
#
#PPPOE_SYNC=-s
#PPPD_SYNC=sync
-
+
### Access Concentrator Name
#
if [ -n "${CONCENTRATORNAME}" ]; then
AUTH=""
fi
- ### Dial On Demand
+ ### Dial On Demand
#
if [ "${RECONNECTION}" != "persistent" ]; then
if [ "${TIMEOUT}" != "0" ] && [ "${TIMEOUT}" != "" ]; then
DEMAND+=" ipcp-accept-remote ipcp-accept-local noipdefault ktune"
fi
fi
-
+
if [ "$TYPE" == "pppoe" ]; then
### When using pppoe-plugin the device has to be the last option
#
[ "${METHOD}" == "PPPOE_PLUGIN" ] && PLUGOPTS+=" $PPP_NIC"
fi
-
+
if [ "$TYPE" == "modem" ]; then
PLUGOPTS=" /dev/${COMPORT} ${DTERATE} connect /etc/ppp/dialer lock modem crtscts"
METHOD="PPPOE_PLUGIN"
PLUGOPTS=" /dev/${COMPORT} ${DTERATE} connect /bin/true lock modem crtscts"
METHOD="PPPOE_PLUGIN"
fi
-
+
### Standard PPP options we always use
#
PPP_STD_OPTIONS="$PLUGOPTS usepeerdns defaultroute noipdefault noauth"
if [ -n "${MRU}" ]; then
PPP_STD_OPTIONS="${PPP_STD_OPTIONS} mru ${MRU}"
fi
-
+
### Debugging
#
if [ "${DEBUG}" == "on" ]; then
else
DEBUG=""
fi
-
+
### PPPoE invocation
#
if [ "$TYPE" == "pppoe" ]; then
PPPOE_CMD="pptp $PPTP_PEER --nolaunchpppd"
METHOD=""
fi
-
+
### Run everything
#
if [ "$METHOD" == "PPPOE_PLUGIN" ]; then
exit 0;
;;
esac
-
-# End
#!/bin/bash
-########################################################################
-# Begin
-#
-# Description : wpa_supplicant Script
-#
-# Authors : IPFire Development Team <developers@ipfire.org>
-#
-# Version : 01.00
-#
-# Notes : This script starts/stops the dhclient if a WPA/WPA2
-# connection to an AP successfull has been established
-# or disconnected.
-#
-########################################################################
-
-. /etc/sysconfig/rc
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+. /etc/sysconfig/rc
. ${rc_functions}
. /etc/init.d/networking/functions.network
#!/bin/sh
-# Begin $rc_base/init.d/alsa
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
-# Stores mixer settings in the default location: /etc/asound.state
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/alsa
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/amazon-ssm-agent
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/amazon-ssm-agent
#!/bin/sh
-# Begin $rc_base/init.d/apcupsd
-
-# Based on sysklogd script from LFS-3.1 and earlier.
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/apcupsd
\ No newline at end of file
#!/bin/sh
-# Begin $rc_base/init.d/avahi
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/avahi
#!/bin/sh
-# Begin $rc_base/init.d/bacula
-
-# Based on sysklogd script from LFS-3.1 and earlier.
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
;;
esac
-# End $rc_base/init.d/bacula
-
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/bird
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/bird
#!/bin/sh
-# Begin $rc_base/init.d/clamav
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/clamav
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/cpufreq
-#
-# Description : Initalisize and startup cpufreq and set a governor
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 01.01
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/cpufreq
-
-
#!/bin/sh
-# Begin $rc_base/init.d/cups
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
-
-# Start or stop the CUPS server based upon the first argument to the script.
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/cups
#!/bin/sh
-# Begin $rc_base/init.d/cyrus-sasl
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/cyrus-sasl
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/dnsdist
-#
-# Description : dnsdist - A DNS load-balancer and more
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/dnsdist
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/fetchmail
-#
-# Description : Fetchmail Init Script
-#
-# Authors : Michael Tremer (ms@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/fetchmail
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/freeradius
-#
-# Description : Initscript for the FreeRADIUS Server
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/freeradius
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/frr
-#
-# Description : FRRouting Suite
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/frr
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/gnump3d
-#
-# Description : GNUMP3d Init Script
-#
-# Authors : Michael Tremer (ms@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/gnump3d
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/guardian
-#
-# Description : Guardian Initscript
-#
-# Authors : Kim Wölfel for ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/guardian
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/haproxy
-#
-# Description : HAProxy init script
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/haproxy
#!/bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/keepalived
-#
-# Description : keepalive daemon initscript
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/keepalived
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/lcdproc
-#
-# Description :
-#
-# Authors :
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/lcdproc
+++ /dev/null
-#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/lcr
-#
-# Description : Linux Call Router Script
-#
-# Authors : Arne Fitzenreiter (arne_f@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
-
-. /etc/sysconfig/rc
-. ${rc_functions}
-
-case "${1}" in
- start)
- boot_mesg "Starting Linux Call Router..."
- nice --10 /usr/sbin/lcr fork >> /var/log/lcr/console.log 2>&1
- evaluate_retval
- ;;
-
- stop)
- boot_mesg "Stopping Linux Call Router..."
- killproc /usr/sbin/lcr
- ;;
-
- restart)
- ${0} stop
- sleep 1
- ${0} start
- ;;
-
- status)
- statusproc /usr/sbin/lcr
- ;;
- *)
- echo "Usage: ${0} {start|stop|restart|status}"
- exit 1
- ;;
-esac
-
-# End $rc_base/init.d/lcr
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/libvirtd
-#
-# Description : libvirtd init script
-#
-# Authors : Jonatan Schlag - jonatan.schlag@ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/libvirtd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/mdns-repeater
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/mdns-repeater
#!/bin/sh
-# Begin $rc_base/init.d/messagebus
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: dnicholson $
-#$Date: 2007-10-21 11:33:30 -0500 (Sun, 21 Oct 2007) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/messagebus
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/minidlna
-#
-# Description : minidlna - UPNP/DLNA streaming server
-#
-# Authors : Michael Tremer <michael.tremer@ipfire.org>
-#
-# Version : 01.00
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/minidlna
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/monit
-#
-# Description : monit monitoring daemon
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/monit
#!/bin/sh
-# Begin $rc_base/init.d/mpd
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
-# Stores mixer settings in the default location: /etc/asound.state
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/alsa
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/netatalk
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/netatalk
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/net-snmp
-#
-# Description : This is a script that starts net-snmp as deamon
-#
-# Authors : Peter Pfeiffer (peterman@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
loadproc /usr/sbin/snmpd -c /etc/snmpd.conf > /dev/null
evaluate_retval
;;
-
+
stop)
boot_mesg "Stopping net-snmp - SNMPD..."
killproc /usr/sbin/snmpd
exit 1
;;
esac
-
-# End $rc_base/init.d/net-snmp
#!/bin/sh
-# Begin $rc_base/init.d/nfs-server
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2006-09-10 19:41:47 -0500 (Sun, 10 Sep 2006) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/nfs-server
#!/bin/sh
-# Begin $rc_base/init.d/nrpe
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/nrpe
#! /bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/
-#
-# Description : init-script for open-vm-tools
-#
-# Authors : Jan Paul Tuecking (earl@ipfire.org)
-#
-# Version : 1.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
fi
fi
;;
-
+
stop)
if ps ax | grep -v grep | grep /usr/bin/vmtoolsd > /dev/null
then
exit 1
;;
esac
-
-# End $rc_base/init.d/
#!/bin/sh
-# Begin $rc_base/init.d/pmacct
-
-# Based on sysklogd script from LFS-3.1 and earlier.
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
;;
esac
-# End $rc_base/init.d/pmacct
-
#!/bin/sh
-# Begin $rc_base/init.d/postfix
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/postfix
#!/bin/sh
-# Begin $rc_base/init.d/qemu-guest-agent
-
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-
-# End $rc_base/init.d/qemu-guest-agent
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/rpcbind
-#
-# Description : rpcbind init script
-#
-# Authors : Jonatan Schlag jonatan.schlag@ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
;;
esac
-
-# End $rc_base/init.d/rpcbind
#!/bin/sh
-# Begin $rc_base/init.d/samba
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/samba
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/shairport-sync
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/shairport-sync
#!/bin/sh
-# Begin $rc_base/init.d/sslh
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/sslh
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/stunnel
-#
-# Description : Provides an SSL encryption wrapper.
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/stunnel
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/tftpd
-#
-# Description : This script controls the tftpd server
-#
-# Authors : Michael Tremer <ms@ipfire.org>
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/tftpd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/tor
-#
-# Description : Anonymizing overlay network for TCP
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/tor
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/
-#
-# Description :
-#
-# Authors :
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/vdr
-#
-# Description : This is a script that starts vdr as deamon
-#
-# Authors : Arne Fitzenreiter (arne@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
/usr/sbin/runvdr >/dev/null 2>&1 &
evaluate_retval
;;
-
+
stop)
boot_mesg "Stopping Video Disk Recorder..."
killproc /usr/sbin/vdr
exit 1
;;
esac
-
-# End $rc_base/init.d/vdr
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/vdradmin
-#
-# Description : This is a script that starts vdradmind as deamon
-#
-# Authors : Arne Fitzenreiter (arne@ipfire.org)
-#
-# Version : 01.00
-#
-# Notes : Changes in 01.01
-# : v.2.6.7 needs /var/run/vdradmin dir (earl@ipfire.org)
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
loadproc /usr/bin/vdradmind > /dev/null
evaluate_retval
;;
-
+
stop)
boot_mesg "Stopping VDR Webadministration Tool..."
killproc /usr/bin/vdradmind
exit 1
;;
esac
-
-# End $rc_base/init.d/vdradmin
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/virtlogd
-#
-# Description : virtlogd init script
-#
-# Authors : Jonatan Schlag - jonatan.schlag@ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/virtlogd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/watchdog
-#
-# Description : watchdog daemon initscript
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/watchdog
#!/bin/sh
-# Begin $rc_base/init.d/xinetd
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/xinetd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/zabbix_agentd
-#
-# Description : This script starts the Zabbix Agent as a daemon (zabbix_agentd)
-#
-# Authors : Alexander Koch (ipfire@starkstromkonsument.de)
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/zabbix_agentd
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/acpid
-#
-# Description : ACPI daemon init script
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/acpid
#!/bin/sh
-# Begin $rc_base/init.d/apache
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
/usr/sbin/apachectl -k restart
evaluate_retval
;;
-
+
reload)
boot_mesg "Reloading Apache daemon..."
/usr/sbin/apachectl -k graceful
exit 1
;;
esac
-
-# End $rc_base/init.d/apache
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/beep
-#
-# Description : Plays a short melody when system goes up or down
-#
-# Authors : Michael Tremer - mitch@ipfire.org
-#
-# Version : 01.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
for i in 440 466 494 523 554 587 622 659 698 740 764 831 880; do
play $i
done
-
+
;;
stop)
play $i
done
;;
-
+
up)
for i in 440 622 880; do
play $i
done
;;
-
+
down)
for i in 880 622 440; do
play $i
exit 1
;;
esac
-
-# End $rc_base/init.d/beep
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/checkfs
-#
-# Description : File System Check
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-# A. Luebke - luebke@users.sourceforge.net
-#
-# Version : 00.00
-#
-# Notes :
-#
-# Based on checkfs script from LFS-3.1 and earlier.
-#
-# From man fsck
-# 0 - No errors
-# 1 - File system errors corrected
-# 2 - System should be rebooted
-# 4 - File system errors left uncorrected
-# 8 - Operational error
-# 16 - Usage or syntax error
-# 32 - Fsck canceled by user request
-# 128 - Shared library error
-#
-#########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/checkfs
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/cleanfs
-#
-# Description : Clean file system
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/cleanfs
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/cloud-init
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/cloud-init
#!/bin/sh
-# Begin $rc_base/init.d/collecd
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
else
sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
fi
-
+
# sync after config update...
sync
exit 1
;;
esac
-
-# End $rc_base/init.d/collectd
#!/bin/bash
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
-. /etc/sysconfig/rc
+. /etc/sysconfig/rc
. ${rc_functions}
# Stop if nothing is configured
start)
boot_mesg "Starting connection daemon..."
echo_ok
-
+
while [ "$COUNT" -lt "$MAX" ]; do
if [ ! -e "/var/ipfire/red/keepconnected" ]; then
# User pressed disconnect in gui
sleep 5
(( COUNT+=1 ))
done
-
+
/etc/rc.d/init.d/network stop red
-
+
(( ATTEMPTS+=1 ))
msg_log "Reconnecting: Attempt ${ATTEMPTS} of ${MAXRETRIES}"
if [ "${ATTEMPTS}" -ge "${MAXRETRIES}" ]; then
fi
/etc/rc.d/init.d/network start red >/dev/tty12 2>&1 </dev/tty12 &
;;
-
+
reconnect)
while ( ps ax | grep -q [p]ppd ); do
msg_log "There is a pppd still running. Waiting 2 seconds for exit."
sleep 2
done
-
+
/etc/rc.d/init.d/network restart red
;;
-
+
*)
echo "Usage: $0 {start|reconnect}"
exit 1
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/conntrackd
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/conntrackd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/console
-#
-# Description : Sets keymap and screen font
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-# Alexander E. Patrakov
-#
-# Version : 00.03
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
start)
boot_mesg "Setting up Linux console..."
# There should be no bogus failures below this line!
-
+
# Figure out if a framebuffer console is used
[ -d /sys/class/graphics/fb0 ] && USE_FB=1 || USE_FB=0
-
+
# Figure out the command to set the console into the
# desired mode
is_true "${UNICODE}" &&
MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" ||
MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a"
-
+
# On framebuffer consoles, font has to be set for each vt in
# UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
-
+
! is_true "${USE_FB}" || [ -z "${FONT}" ] ||
MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}"
# used.
# FIXME: Fedora Core also initializes two spare consoles
# - do we want that?
-
+
for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
grep -o '\btty[[:digit:]]*\b'`
do
[ -n "$BROKEN_COMPOSE" ] || BROKEN_COMPOSE="$UNICODE"
! is_true "$BROKEN_COMPOSE" ||
echo "" | loadkeys -c &>/dev/null
-
+
# Convert the keymap from $LEGACY_CHARSET to UTF-8
[ -z "$LEGACY_CHARSET" ] ||
dumpkeys -c "$LEGACY_CHARSET" | loadkeys -u &>/dev/null
exit 1
;;
esac
-
-# End $rc_base/init.d/console
#!/bin/sh
-# Begin $rc_base/init.d/dhcp
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-# Modified for IPFire by Michael Tremer - mitch@ipfire.org
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/dhcp
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/dhcrelay
-#
-# Description : The DHCP Relay Daemon
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/dhcrelay
#!/bin/sh
-# Begin $rc_base/init.d/fcron
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/fcron
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/fireinfo
-#
-# Description : Fireinfo profile generator
-#
-# Authors : IPFire Team
-#
-# Notes : This script saves the fireinfo profile to a file which
-# is needed to show that information on the webinterface.
-# No data is sent to the server.
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/fireinfo
#!/bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
# Exit if firstsetup was already done...
if [ -e /var/ipfire/main/firstsetup_ok ]; then
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/fsresize
-#
-# Description : Resize the root filesystem in the background
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 1.01
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/26fsresize
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/functions
-#
-# Description : Run Level Control Functions
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes : With code based on Matthias Benkmann's simpleinit-msb
-# http://winterdrache.de/linux/newboot/index.html
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
## Environmental setup
# Setup default values for environment
# We are not running on OCI
return 1
}
-
-# End $rc_base/init.d/functions
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/halt
-#
-# Description : Halt Script
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/halt
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/leds
-#
-# Description : Script to setup leds at boot.
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/leds
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/localnet
-#
-# Description : Loopback device
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/localnet
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/lvmeta2
-#
-# Description : LVM2 Metadata Daemon
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/lvmetad
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/modules
-#
-# Description : Module auto-loading script
-#
-# Authors : Zack Winkles
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/modules
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/mountfs
-#
-# Description : File System Mount Script
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/mountfs
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/mountkernfs
-#
-# Description : Mount proc and sysfs
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/mountkernfs
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/mounttmpfs
-#
-# Description : Mount tmpfses
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/mounttmpfs
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/network
-#
-# Description : Network Control Script
-#
-# Authors : Michael Tremer - mitch@ipfire.org
-#
-# Version : 01.00
-#
-# Notes : Written for IPFire by its team
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End /etc/rc.d/init.d/network
#!/bin/sh
-# Begin $rc_base/init.d/ntp
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/ntp
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/pakfire
-#
-# Description : Imports the keyring to make Pakfire operational
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/pakfire
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/partresize
-#
-# Description : Resize the root partition to the drivesize
-# and setup some platform or hardware options in
-# flashimage
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 1.04
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/partresize
#!/bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/random
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/rc
-#
-# Description : Main Run Level Control Script
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
print_error_msg
fi
done
-
-# End $rc_base/init.d/rc
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/reboot
-#
-# Description : Reboot Scripts
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
;;
esac
-
-# End $rc_base/init.d/reboot
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/rngd
-#
-# Description : Random Number Generator Daemon
-#
-# Authors : Michael Tremer <michael.tremer@ipfire.org>
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/rngd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/sendsignals
-#
-# Description : Sendsignals Script
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
;;
esac
-
-# End $rc_base/init.d/sendsignals
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/setclock
-#
-# Description : Setting Linux Clock
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/sh
-# Begin $rc_base/init.d/smartenabler
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/smartenabler
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/smt
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/smt
#!/bin/sh
-# Begin $rc_base/init.d/squid
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/squid
#!/bin/sh
-# Begin $rc_base/init.d/sshd
-
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
-
-#$LastChangedBy: bdubbs $
-#$Date: 2006-04-15 17:34:16 -0500 (Sat, 15 Apr 2006) $
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/sshd
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/suricata
-#
-# Description : Suricata Initscript
-#
-# Author : Stefan Schantl <stefan.schantl@ipfire.org>
-#
-# Version : 01.03
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
# Don't report returncode of rm if suricata was not started
exit 0
;;
-
+
status)
statusproc /usr/bin/suricata
;;
-
+
restart)
$0 stop
$0 start
# Generate firewall rules.
generate_fw_rules
;;
-
+
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
chmod 644 /var/log/suricata/* 2>/dev/null
-
-# End $rc_base/init.d/suricata
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/swap
-#
-# Description : Swap Control Script
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/swap
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/swconfig
-#
-# Description : Script to setup lan switch.
-# don't edit this script! If you want change the functions
-# create an own script called swconfig.user
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/swconfig
-
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/sysctl
-#
-# Description : File uses /etc/sysctl.conf to set kernel runtime
-# parameters
-#
-# Authors : Nathan Coulson (nathan@linuxfromscratch.org)
-# Matthew Burgress (matthew@linuxfromscratch.org)
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
;;
status)
- sysctl -a
+ sysctl -a
;;
*)
exit 1
;;
esac
-
-# End $rc_base/init.d/sysctl
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/sysklogd
-#
-# Description : Sysklogd loader
-#
-# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/sysklogd
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/
-#
-# Description :
-#
-# Authors :
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/udev
-#
-# Description : Udev cold-plugging script
-#
-# Authors : Zack Winkles, Alexander E. Patrakov
-#
-# Version : 00.02
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/udev
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/udev_retry
-#
-# Description : Udev cold-plugging script (retry)
-#
-# Authors : Alexander E. Patrakov
-#
-# Version : 00.02
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
for file in /dev/.udev/failed/*/uevent ; do
echo "add" >"${file}"
done 2>/dev/null
-
+
# Now wait for udevd to process the uevents we triggered
/bin/udevadm settle
evaluate_retval
exit 1
;;
esac
-
-# End $rc_base/init.d/udev_retry
#!/bin/sh
-# Begin $rc_base/init.d/unbound
-
-# Description : Unbound DNS resolver boot script for IPfire
-# Author : Marcel Lorenz <marcel.lorenz@ipfire.org>
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/unbound
#!/bin/sh
-# Begin $rc_base/init.d/vnstat
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. $rc_functions
exit 1
;;
esac
-
-# End $rc_base/init.d/vnstat
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/waitdrives
-#
-# Description : Wait for drives before fscheck/mount
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 00.00
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
exit 1
;;
esac
-
-# End $rc_base/init.d/waitdrives
#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/wlan_client
-#
-# Description : Wireless client initscript
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
boot_mesg "Stopping wireless client on ${RED_DEV}..."
killproc wpa_supplicant
-
+
# Tidy up /tmp directory.
rm -f /tmp/wpa_ctrl_*
}
exit 1
;;
esac
-
-# End $rc_base/init.d/wlan_client
*
* (c) Lawrence Manning, 2001
* Contains prototypes for library functions.
- *
+ *
*/
#ifndef ___LIBSMOOTH_H
int runcommandwithstatus(const char *command, const char* title, const char *message, const char* output);
int runhiddencommandwithstatus(const char *command, const char* title, const char *message, const char* output);
int splashWindow(const char* title, const char* message, unsigned int timeout);
-int checkformodule(const char *module);
+int checkformodule(const char *module);
int replace(char filename1[], char *from, char *to);
char* get_version(void);
* (c) Lawrence Manning, 2001
* Contains library functions.
*/
-
+
#include "libsmooth.h"
#include <libintl.h>
free(buf);
newtFormAddComponent(f, t);
-
+
s = newtScale(1, 3, width - 2, lines);
newtScaleSet(s, progress);
-
+
newtFormAddComponent(f, s);
newtDrawForm(f);
goto EXIT;
}
setvbuf(p, NULL, _IOLBF, 255);
-
+
while (fgets(buffer, STRING_SIZE, p)) {
newtScaleSet(s, ++progress);
- newtRefresh();
+ newtRefresh();
}
rc = pclose(p);
-
+
EXIT:
newtFormDestroy(f);
newtPopWindow();
-
+
return rc;
}
fprintf(stderr, "Unable to open /proc/modules in checkformodule()\n");
return 0;
}
-
+
while (fgets(buffer, STRING_SIZE, file))
{
if (strncmp(buffer, module, strlen(module)) == 0)
}
}
}
-
+
EXIT:
fclose(file);
-
+
return result;
-}
-
+}
+
int _replace_string(char string[], char *from, char *to)
{
int fromlen = strlen(from);
if (strlen(to) > 0) {
/* Replace string */
ret = _replace_string (temp, from, to);
-
+
/* Write string to new file */
fputs(temp, file2);
} else {
/* Remove string when to is NULL */
- if (!strstr(temp, from))
+ if (!strstr(temp, from))
fputs(temp, file2);
}
}
/* Move the file */
rename (filename2, filename1);
-
+
return (ret);
}
*
* (c) Lawrence Manning, 2001
* Contains functions for manipulation files full of VAR=VAL pairs.
- *
+ *
* 2003-07-27 Robert Kerr - Added cooperative file locking to prevent any
* clashes between setuid programs reading configuration and cgi scripts
* trying to write it
- *
+ *
*/
-
+
#include "libsmooth.h"
/* Sets up the list. First entry is a dummy one to avoid having to special
struct keyvalue *initkeyvalues(void)
{
struct keyvalue *head = malloc(sizeof(struct keyvalue));
-
+
strcpy(head->key, "KEY");
strcpy(head->value, "VALUE");
head->next = NULL;
-
+
return head;
}
{
struct keyvalue *cur = head->next;
struct keyvalue *next;
-
+
while (cur)
{
next = cur->next;
char buffer[STRING_SIZE];
char *temp;
char *key, *value;
-
+
if (!(file = fopen(filename, "r")))
return 0;
-
+
if (flock(fileno(file), LOCK_SH))
{
fclose(file);
return 0;
}
-
+
while (fgets(buffer, STRING_SIZE, file))
{
temp = buffer;
if (strlen(key))
appendkeyvalue(head, key, value);
}
-
+
flock(fileno(file), LOCK_UN);
fclose(file);
{
FILE *file;
struct keyvalue *cur = head->next;
-
+
if (!(file = fopen(filename, "w")))
return 0;
-
+
if (flock(fileno(file), LOCK_EX))
{
fclose(file);
return 0;
}
-
-
+
+
while (cur)
{
/* No space in value? If there is, we need to quote the value
}
flock(fileno(file), LOCK_UN);
fclose(file);
-
+
return 1;
}
}
const char* name = argv[1];
-
+
if (strlen(name) > 32) {
fprintf(stderr, "\nString to large.\n\naddonctrl addon (start|stop|restart|reload|enable|disable)\n\n");
exit(1);
* (c) IPFire Team, 2011
*
* Simple program that calls "sendprofile" as the root user.
- *
+ *
*/
-
+
#include <stdlib.h>
#include "setuid.h"
{
if (!(initsetuid()))
exit(1);
-
+
safe_system("/usr/bin/sendprofile");
-
+
return 0;
}
/* IPFire helper program - IPStat
*
* Get the list from IPTABLES -L
- *
+ *
* Optional commandline parameters:
- * -x
+ * -x
* instruct iptables to expand numbers
- * -f
- * display filter table
+ * -f
+ * display filter table
* -n
* display nat table
* -m
unsigned int table_set = 0;
int opt;
-
+
if (!(initsetuid()))
exit(1);
* (c) Lawrence Manning, 2001
* Installer helper for redirecting stdout/stderr to a file/terminal.
* init calls ash through this program to shove it on a tty.
- *
+ *
* $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $
- *
+ *
*/
#include <stdio.h>
if (argc >= 2)
{
int fd;
-
+
if ((fd = open(argv[1], O_RDWR)) == -1)
{
printf("Couldn't open device\n");
dup2(fd, 2);
/* Now its sending/reading on that device. */
}
-
- if (argc >= 3)
+
+ if (argc >= 3)
execvp(argv[2], &argv[2]);
else
printf("No command\n");
// Check what command is asked
if (argc==1)
- {
+ {
fprintf (stderr, "Missing reboot command!\n");
return 1;
}
/*
This module is responsible for start stop of the vpn system.
-
+
1) it allows AH & ESP to get in from interface where a vpn is mounted
The NAT traversal is used on the udp 4500 port.
2) it starts the ipsec daemon
The RED interface is a problem because it can be up or down a startup.
- Then, the state change and it must not affect other VPN mounted on
+ Then, the state change and it must not affect other VPN mounted on
other interface.
Unfortunatly, openswan 1 cannot do that correctly. It cannot use an
interface without restarting everything.
/*
return values from the vpn config file or false if not 'on'
*/
-int decode_line (char *s,
+int decode_line (char *s,
char **key,
char **name,
char **type
// check other syntax
if (! *name)
return 0;
-
+
if (strspn(*name, LETTERS_NUMBERS) != strlen(*name)) {
fprintf(stderr, "Bad connection name: %s\n", *name);
return 0;
char command[STRING_SIZE];
// Bring down the connection (if established).
- snprintf(command, STRING_SIZE - 1,
+ snprintf(command, STRING_SIZE - 1,
"/usr/sbin/ipsec down %s >/dev/null", name);
safe_system(command);
ipsec_reload();
// Bring down the connection.
- snprintf(command, STRING_SIZE - 1,
+ snprintf(command, STRING_SIZE - 1,
"/usr/sbin/ipsec down %s >/dev/null", name);
safe_system(command);
int main(int argc, char *argv[]) {
struct keyvalue *kv = NULL;
-
+
if (argc < 2) {
usage();
exit(1);
fprintf(stderr, "Cannot read ethernet settings\n");
exit(1);
}
-
+
if (strcmp(enableblue, "on") == 0) {
if (!findkey(kv, "BLUE_DEV", blueif)) {
exit(1);
exit(1);
}
- /* we got one device, so lets proceed further */
+ /* we got one device, so lets proceed further */
if (!findkey(kv, "DDEST_PORT", dport)){
fprintf(stderr, "Cannot read DDEST_PORT\n");
exit(1);
void startDaemon(void) {
char command[STRING_SIZE];
-
+
if (!((strcmp(enablered, "on") == 0) || (strcmp(enableblue, "on") == 0) || (strcmp(enableorange, "on") == 0))) {
fprintf(stderr, "OpenVPN is not enabled on any interface\n");
exit(1);
}
else {
ovpnInit();
-
+
if( (strcmp(argv[1], "-s") == 0) || (strcmp(argv[1], "--start") == 0) ) {
setFirewallRules();
startDaemon();
* Licence. See the file COPYING for details.
*
* (c) Alan Hourihane, 2003
- *
+ *
*
* $Id: rebuildhosts.c,v 1.3.2.6 2005/07/11 10:56:47 franck78 Exp $
*
fprintf(stderr, "Couldn't read main settings\n");
exit(1);
}
- strcpy(hostname, SNAME );
+ strcpy(hostname, SNAME );
findkey(kv, "HOSTNAME", hostname);
findkey(kv, "DOMAINNAME", domainname);
freekeyvalues(kv);
#define BUFFER_SIZE 1024
-char command[BUFFER_SIZE];
+char command[BUFFER_SIZE];
int main(int argc, char *argv[]) {
if (!(initsetuid()))
fprintf(stderr, "Cannot read RED_TYPE\n");
exit(1);
}
-
+
/* Make sure it's the right type */
- if (!(strcmp(s, "STATIC")==0))
+ if (!(strcmp(s, "STATIC")==0))
exit(0);
/* Get the RED interface details */
fprintf(stderr, "Cannot read RED settings\n");
exit(1);
}
-
+
if (!VALID_DEVICE(red_dev))
{
fprintf(stderr, "Bad red_dev: %s\n", red_dev);
* This program is distributed under the terms of the GNU General Public
* Licence. See the file COPYING for details.
* Simple header file for all setuid progs.
- *
+ *
*/
#ifndef SETUID_H
*
* (c) Mark Wormgoor, 2001
* Simple program intended to be installed setuid(0) that can be used for
- * restarting SSHd.
- *
+ * restarting SSHd.
+ *
* $Id: sshctrl.c,v 1.3 2003/12/11 10:57:34 riddles Exp $
- *
+ *
*/
#include <stdio.h>
#define BUFFER_SIZE 1024
-char command[BUFFER_SIZE];
+char command[BUFFER_SIZE];
int main(int argc, char *argv[])
{
*
* $Id$
*
- * Edited by the IPFire Team to change var log messages
+ * Edited by the IPFire Team to change var log messages
*/
#include <stdio.h>
exit(ERR_CONFIG);
}
close(config_fd);
-
+
if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)
{
perror("Unable to replace old config file");
if (strcmp(argv[1], "cron") == 0){
safe_system("rm /etc/fcron.*/updxlrator 2&>/dev/null");
-
+
if (strcmp(argv[2], "daily") == 0){
safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.daily/updxlrator");
} else if (strcmp(argv[2], "weekly") == 0){
if (strcmp(argv[1], "cron") == 0){
safe_system("rm /etc/fcron.*/urlfilter 2&>/dev/null");
-
+
if (strcmp(argv[2], "daily") == 0){
safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.daily/urlfilter");
} else if (strcmp(argv[2], "weekly") == 0){
* Licence. See the file COPYING for details.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
+ *
* IPFire.org - A linux based firewall
* Copyright (C) 2017-2018 Stephan Feddersen <sfeddersen@ipfire.org>
*
# A small color-hash :D
my %color;
- $color{'normal'} = "\033[0m";
+ $color{'normal'} = "\033[0m";
$color{'black'} = "\033[0;30m";
$color{'darkgrey'} = "\033[1;30m";
$color{'blue'} = "\033[0;34m";
sub message {
my $message = shift;
-
+
logger("$message");
if ( $enable_colors == 1 ) {
if ("$message" =~ /ERROR/) {
}
}
print "$message\n";
-
+
}
sub logger {
my $gethost = shift;
my (@server, $host, $proto, $file, $i);
my $allok = 0;
-
+
use File::Basename;
$bfile = basename("$getfile");
-
+
logger("DOWNLOAD STARTED: $getfile");
- $i = 0;
+ $i = 0;
while (($allok == 0) && $i < 5) {
$i++;
-
+
if ("$gethost" eq "") {
@server = selectmirror();
$proto = $server[0];
$host = $gethost;
$file = $getfile;
}
-
+
$proto = "HTTPS" unless $proto;
-
+
logger("DOWNLOAD INFO: Host: $host ($proto) - File: $file");
# Init LWP::UserAgent, request SSL hostname verification
);
$ua->agent("Pakfire/$Conf::version");
$ua->timeout(20);
-
+
my %proxysettings=();
&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
my $remote_headers = $result->headers;
$total_size = $remote_headers->content_length;
logger("DOWNLOAD INFO: $file has size of $total_size bytes");
-
+
my $response = $ua->get($url, ':content_cb' => \&callback );
message("");
-
+
my $code = $response->code();
my $log = $response->status_line;
logger("DOWNLOAD INFO: HTTP-Status-Code: $code - $log");
-
+
if ( $code eq "500" ) {
message("Giving up: There was no chance to get the file \"$getfile\" from any available server.\nThere was an error on the way. Please fix it.");
return 1;
}
-
+
if ($response->is_success) {
if (open(FILE, ">$Conf::tmpdir/$bfile")) {
print FILE $final_data;
sub getmirrors {
my $force = shift;
my $age;
-
+
use File::Copy;
-
+
if ( -e "$Conf::dbdir/lists/server-list.db" ) {
my @stat = stat("$Conf::dbdir/lists/server-list.db");
my $time = time();
# Force an update.
$force = "force";
}
-
+
if ("$force" eq "force") {
fetchfile("$Conf::version/lists/server-list.db", "$Conf::mainserver");
move("$Conf::cachedir/server-list.db", "$Conf::dbdir/lists/server-list.db");
sub getcoredb {
my $force = shift;
my $age;
-
+
use File::Copy;
-
+
if ( -e "$Conf::dbdir/lists/core-list.db" ) {
my @stat = stat("$Conf::dbdir/lists/core-list.db");
my $time = time();
# Force an update.
$force = "force";
}
-
+
if ("$force" eq "force") {
fetchfile("lists/core-list.db", "");
move("$Conf::cachedir/core-list.db", "$Conf::dbdir/lists/core-list.db");
# Usage is always with an argument.
my $force = shift;
my $age;
-
+
use File::Copy;
-
+
if ( -e "$Conf::dbdir/lists/packages_list.db" ) {
my @stat = stat("$Conf::dbdir/lists/packages_list.db");
my $time = time();
# Force an update.
$force = "force";
}
-
+
if ("$force" eq "force") {
fetchfile("lists/packages_list.db", "");
move("$Conf::cachedir/packages_list.db", "$Conf::dbdir/lists/packages_list.db");
sub dblist {
### This subroutine lists the packages.
- # You may also pass a filter: &Pakfire::dblist(filter)
+ # You may also pass a filter: &Pakfire::dblist(filter)
# Usage is always with two arguments.
# filter may be: all, notinstalled, installed
my $filter = shift;
my $prog;
my %metadata;
my @templine;
-
- ### Make sure that the list is not outdated.
+
+ ### Make sure that the list is not outdated.
#dbgetlist("noforce");
open(FILE, "<$Conf::dbdir/lists/packages_list.db");
}
}
}
-
+
opendir(DIR,"$Conf::dbdir/installed");
my @files = readdir(DIR);
closedir(DIR);
} else {
if ("$Pakfire::enable_colors" eq "1") {
if (&isinstalled("$templine[0]")) {
- $use_color = "$color{'red'}"
+ $use_color = "$color{'red'}"
} else {
$use_color = "$color{'green'}"
}
sub resolvedeps_one {
my $pak = shift;
-
+
getmetafile("$pak");
-
+
message("PAKFIRE RESV: $pak: Resolving dependencies...");
-
+
my %metadata = parsemetafile("$Conf::dbdir/meta/meta-$pak");
my @all;
my @deps = split(/ /, $metadata{'Dependencies'});
} else {
message("PAKFIRE RESV: $pak: Need to install dependency: $_");
push(@all,$_);
- }
+ }
}
}
sub cleanup {
my $dir = shift;
my $path;
-
+
logger("CLEANUP: $dir");
-
+
if ( "$dir" eq "meta" ) {
$path = "$Conf::dbdir/meta";
} elsif ( "$dir" eq "tmp" ) {
sub getmetafile {
my $pak = shift;
-
+
unless ( -e "$Conf::dbdir/meta/meta-$pak" ) {
fetchfile("meta/meta-$pak", "");
move("$Conf::cachedir/meta-$pak", "$Conf::dbdir/meta/meta-$pak");
}
-
+
if ( -z "$Conf::dbdir/meta/meta-$pak" ) {
fetchfile("meta/meta-$pak", "");
move("$Conf::cachedir/meta-$pak", "$Conf::dbdir/meta/meta-$pak");
}
-
+
open(FILE, "<$Conf::dbdir/meta/meta-$pak");
my @line = <FILE>;
close(FILE);
-
+
open(FILE, ">$Conf::dbdir/meta/meta-$pak");
foreach (@line) {
my $string = $_;
sub getsize {
my $pak = shift;
-
+
getmetafile("$pak");
-
+
if (my %metadata = parsemetafile("$Conf::dbdir/meta/meta-$pak")) {
return $metadata{'Size'};
}
open(FILE, "<$metafile");
@file = <FILE>;
close(FILE);
-
+
foreach (@file) {
@templine = split(/\: /,$_);
if ($templine[1]) {
sub decryptpak {
my $pak = shift;
-
+
cleanup("tmp");
-
+
my $file = getpak("$pak", "noforce");
-
+
logger("DECRYPT STARTED: $pak");
my $return = system("cd $Conf::tmpdir/ && gpg -d --batch --quiet --no-verbose --status-fd 2 --output - < $Conf::cachedir/$file 2>/dev/null | tar x");
$return %= 255;
my $force = shift;
getmetafile("$pak");
-
+
my %metadata = parsemetafile("$Conf::dbdir/meta/meta-$pak");
my $file = $metadata{'File'};
-
+
unless ($file) {
message("No filename given in meta-file.");
exit 1;
}
-
+
unless ( "$force" eq "force" ) {
if ( -e "$Conf::cachedir/$file" ) {
return $file;
}
}
-
+
fetchfile("paks/$file", "");
return $file;
}
sub setuppak {
my $pak = shift;
-
+
message("PAKFIRE INST: $pak: Decrypting...");
decryptpak("$pak");
-
+
message("PAKFIRE INST: $pak: Copying files and running post-installation scripts...");
my $return = system("cd $Conf::tmpdir && NAME=$pak ./install.sh >> $Conf::logdir/install-$pak.log 2>&1");
$return %= 255;
$Conf::core_mine-- if ($tree eq "testing" || $tree eq "unstable");
message("CORE UPGR: Upgrading from release $Conf::core_mine to $core_release");
-
+
my @seq = `seq $Conf::core_mine $core_release`;
shift @seq;
my $release;
chomp($release);
getpak("core-upgrade-$release");
}
-
+
foreach $release (@seq) {
chomp($release);
upgradepak("core-upgrade-$release");
}
-
+
system("echo $core_release > $Conf::coredir/mine");
-
+
} else {
message("CORE ERROR: No new upgrades available. You are on release $Conf::core_mine.");
}
my $size = shift;
#$size = $size / 1024;
my $unit;
-
+
if ($size > 1023*1024) {
$size = ($size / (1024*1024));
$unit = "MB";
open(FILE, "</proc/sys/kernel/random/uuid");
my @line = <FILE>;
close(FILE);
-
+
open(FILE, ">$Conf::dbdir/uuid");
foreach (@line) {
print FILE $_;
$show_bfile = substr($bfile,0,17)."...";
} else {
$show_bfile = $bfile;
- }
+ }
$progress = sprintf("%.2f%%", 100*$got/+$total);
sprintf "$color{'lightgreen'}%-20s %7s |%-${width}s| %10s$color{'normal'}\r",$show_bfile, $progress, $char x (($width-1)*$got/$total). '>', beautifysize($got);
}
$ENV{"GNUPGHOME"} = "/opt/pakfire/etc/.gnupg";
require "/opt/pakfire/lib/functions.pl";
-
+
my $interactive = 1;
my $force = "noforce";
my $locked;
-
+
&Pakfire::logger("PAKFIRE INFO: IPFire Pakfire $Conf::version started!");
### Check if we are running as root
&Pakfire::message("PAKFIRE ERROR: You must run pakfire as user root!");
exit 1;
}
-
+
unless ( -e "/var/ipfire/red/active" ) {
&Pakfire::message("PAKFIRE ERROR: You need to be online to run pakfire!");
exit 2;
# Close filehandle.
close(LOCK);
-
+
### Check if we are started by another name
#
if ( $0 =~ /pakfire-update$/ ) {
$ARGV[0] = "upgrade";
$interactive = 0;
}
-
+
unless (@ARGV) {
&Pakfire::usage;
}
-
+
foreach (@ARGV) {
if ("$_" =~ "^-") {
# Turn off interactive mode
$interactive = 0 if ("$_" eq "--non-interactive");
$interactive = 0 if ("$_" eq "-y");
-
+
# Turn off shell colors - Bad for displaying in webinterface
$Pakfire::enable_colors = 0 if ("$_" eq "--no-colors");
-
+
# Turn on force mode
$force = "force" if ("$_" eq "-f" );
$force = "force" if ("$_" eq "--force" );
if ("$ARGV[0]" eq "install") {
shift;
-
- ### Make sure that the list is not outdated.
+
+ ### Make sure that the list is not outdated.
&Pakfire::dbgetlist("noforce");
open(FILE, "<$Conf::dbdir/lists/packages_list.db");
my @db = <FILE>;
close(FILE);
-
+
my $dep;
my @deps;
my $pak;
$return = &Pakfire::isinstalled($pak);
if ($return eq 0) {
&Pakfire::message("PAKFIRE INFO: $pak is already installed");
- next;
+ next;
}
$found = 0;
foreach (@db) {
}
}
}
-
+
unless (@paks) {
&Pakfire::message("PAKFIRE ERROR: No packages to install. Exiting...");
exit 1;
$size = &Pakfire::beautifysize($size);
&Pakfire::message("PAKFIRE INFO: $pak \t - $size");
}
-
+
my $totalsize;
foreach $pak (@all) {
$totalsize = ($totalsize + &Pakfire::getsize("$pak"));
&Pakfire::message("");
&Pakfire::message("PAKFIRE INFO: Total size: \t ~ $totalsize");
&Pakfire::message("");
-
+
if ($interactive) {
&Pakfire::message("PAKFIRE INFO: Is this okay? [y/N]");
my $ret = <STDIN>;
} else {
&Pakfire::logger("PAKFIRE INFO: Interaction skipped.");
}
-
+
# my %sort = map{ $_, 1 } @all;
# @all = sort keys %sort;
foreach $pak (@deps) {
&Pakfire::setuppak("$pak") if ($pak ne "");
}
-
+
foreach $pak (@paks) {
&Pakfire::setuppak("$pak") if ($pak ne "");
}
-
+
} elsif ("$ARGV[0]" eq "remove") {
shift;
-
+
my @paks;
my $pak;
foreach $pak (@ARGV) {
push(@paks, $pak);
}
}
-
+
unless (@paks) {
&Pakfire::message("PAKFIRE ERROR: No packages to remove. Exiting...");
exit 1;
}
-
+
&Pakfire::message("");
&Pakfire::message("");
&Pakfire::message("PAKFIRE INFO: Packages to remove:");
$size = &Pakfire::beautifysize($size);
&Pakfire::message("PAKFIRE INFO: $pak \t - $size");
}
-
+
if ($interactive) {
&Pakfire::message("PAKFIRE INFO: Is this okay? [y/N]");
my $ret = <STDIN>;
exit 1;
}
}
-
+
foreach $pak (@paks) {
&Pakfire::removepak("$pak");
}
-
-
+
+
} elsif ("$ARGV[0]" eq "update") {
&Pakfire::makeuuid();
&Pakfire::getmirrors("$force");
}
}
}
-
+
# Download packages
foreach $pak (@upgradepaks) {
&Pakfire::getpak("$pak", "");
foreach $pak (@upgradepaks) {
&Pakfire::upgradepak("$pak");
}
-
+
} elsif ("$ARGV[0]" eq "list") {
if ("$ARGV[1]" =~ /installed|notinstalled/) {
&Pakfire::dblist("$ARGV[1]", "noweb");
} else {
- &Pakfire::message("PAKFIRE WARN: Not a known option $ARGV[1]") if ($ARGV[1]);
+ &Pakfire::message("PAKFIRE WARN: Not a known option $ARGV[1]") if ($ARGV[1]);
&Pakfire::dblist("all", "noweb");
}
-
+
} elsif ("$ARGV[0]" eq "resolvedeps") {
foreach (@ARGV) {
next if ("$_" eq "resolvedeps");
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
# FIXME: edit this lines before release
IPFVER=2.27
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2016 IPFire Team <alexander.marx@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/usr/bin/perl
-#
-# IPFire Connection Scheduler (F)Cron Job
-#
-# This code is distributed under the terms of the GPL
-# The original code is taken from weizen_42.
-# See /home/httpd/cgi-bin/connscheduler.cgi
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
use strict;
return;
}
- # now wait for active triggerfile and ppp daemon to disappear
+ # now wait for active triggerfile and ppp daemon to disappear
# wait maximum 60 seconds
my $counter = 60;
sleep 1;
- while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
+ while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
{
sleep 1;
$counter--;
# wait maximum 60 seconds
my $counter = 60;
sleep 1;
- while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
+ while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 )
{
sleep 1;
$counter--;
## FIXME: do we need to do this ?
sleep($sleep_after_profile);
&dial();
- }
+ }
}
}
- if ( $CONNSCHED::config[$i]{'ACTION'} eq 'reconnect' )
+ if ( $CONNSCHED::config[$i]{'ACTION'} eq 'reconnect' )
{
&reconnect()
}
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
###############################################################################
# sort conntrack table entries based on ip addresses
-# @parm sort field
+# @parm sort field
do_ip_sort() {
sed \
-r \
}
# sort conntrack table entries based on port addresses
-# @parm sort field
+# @parm sort field
do_port_sort() {
sed \
-r \
fi
if [[ '1 2' =~ $1 ]]; then
- do_ip_sort $1
+ do_ip_sort $1
elif [[ '3 4' =~ $1 ]]; then
do_port_sort $(($1-2))
elif [[ '5' =~ $1 ]]; then
#!/bin/bash
###############################################################################
# #
-# IPFire.org - A Linux-based firewall #
-# Copyright (C) 2020 IPFire Team <info@ipfire.org> #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# Remove all old settings from files
local file
- for file in "${FILES[@]}"; do
+ for file in "${FILES[@]}"; do
# Remove DNS, DNS0, DNS1 and DNS2
sed -Ei "/^DNS[012]?=/d" "${file}"
done
if [ "${FORCE_TCP}" = "on" ]; then
echo "PROTO=TCP" >> /var/ipfire/dns/settings
fi
-
+
# Run in recursor mode
if [ "${USE_FORWARDERS}" = "0" ]; then
# Remove all servers
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2013 Alexander Marx <amarx@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/bash
-
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2020 IPFire Development Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2020 IPFire Team <info@ipfire.org>. #
-# #
-############################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
PATHS=(
/usr/lib
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
if (-e "/var/run/hddshutdown-$array[$#array]" && $status !~/standby/)
{
if ($debug){print "Remove wrong standby marking\n";}
- if ( -e "/var/run/hddshutdown-$array[$#array]" ) { system("unlink /var/run/hddshutdown-$array[$#array]"); }
+ if ( -e "/var/run/hddshutdown-$array[$#array]" ) { system("unlink /var/run/hddshutdown-$array[$#array]"); }
}
if ($debug){print "Device ".$_." has ".$newdiskstats." write and read Requests, was ".$diskstats." at last run.\n";}
if ($debug){print "Setting Device ".$_." to standby ... ";}
$status = `hdparm -y /dev/$_ 2>&1`;
chomp $status;
- if ($status !~/Invalid/)
- {
+ if ($status !~/Invalid/)
+ {
if ($debug){print "OK\n";}
system("touch /var/run/hddshutdown-$array[$#array]");
}
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2015 IPFire Team #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/usr/bin/perl
-
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2008-2013 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/usr/bin/python3
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2007-2020 IPFire Team <info@ipfire.org>. #
-# #
-############################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
import argparse
import logging
#!/usr/bin/perl
-# Converter script for old openvpn clients
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
my %net=();
my %ovpnconfig=();
my @serverconf=();
#!/usr/bin/perl
-# Converter script for adding existing OpenVPN N2N connections to collectd
-# Used for core update 89
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
my %ovpnconfig=();
#!/usr/bin/perl -w
-use strict;
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
-##########################################
-##
-## DESCRIPTION
-##
-## The tc-graph daemon script: "tc-collector"
-## Which is part of the ADSL-optimizer.
-##
-## The script will become a daemon and periodically collect data
-## from the Linux traffic control system. The collected data is
-## stored in some RRD-data files, which is created automatically by
-## the script if they don't exist.
-##
-## GRAPHs
-##
-## How the RRD-data is displayed as graphs is not part of the
-## tc-collector tool. But we recommend using the RRD-frontend 'ddraw'.
-## We have included some 'ddraw' examples (which is hardcoded to use
-## files from '/var/spool/rrdqueues').
-##
-## drraw: http://web.taranis.org/drraw/
-##
-##
-## REQUIRES
-##
-## RRDtools Perl interface RRDs
-## The "tc" command.
-##
-##
-## AUTHOR
-## Jesper Dangaard Brouer <hawk@diku.dk>, d.16/4-2004
-##
-## CHANGELOG
-## 2004-04-16: Initial version.
-## 2004-05-27: Daemon version.
-##
-## $Id: tc-collector.pl,v 1.12 2005/03/19 19:31:08 hawk Exp $
-##########################################
-
-# TODO:
-# * Calc time used to parse, use to make time steps more precise
-# * Device list support
-# * Detecting the correct devices
+use strict;
# Configuration options:
#
#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2018 IPFire-Team <info@ipfire.org>. #
-# #
-############################################################################
-#
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
KVER=`uname -r`
dracut --force --early-microcode --xz /boot/initramfs-$KVER.img $KVER
#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
case "$1" in
ide)
rm -f /var/ipfire/extrahd/scan
#!/bin/sh
-#
-# IPCop CGIs
-#
-# This file is part of the IPCop Project
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) Eric Oberlander June 2002
-# (c) Eric Oberlander December 2002 - internationalisation added
-#
-# /usr/local/bin/settime
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
ongreen=1
green=$(cat /var/ipfire/ethernet/settings | grep GREEN_NETADDRESS)
* ) logger -t ipfire "ntpdate error" ;;
esac
fi
- fi
+ fi
else
echo Missing parameter
fi
#!/bin/sh
-#
-# IPCop CGIs
-#
-# This file is part of the IPCop Project
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) Eric Oberlander June 2002
-#
-# /usr/local/bin/timecheck
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
if [ -e /var/ipfire/time/enable ]; then
if [ $(cat /var/ipfire/time/settings | grep period) ] && [ -e /var/lock/time/counter ]; then
/usr/local/bin/settime $(cat /var/ipfire/time/settime.conf)
fi
fi
-fi
+fi
#!/bin/bash
-############################################################################
-# #
-# This file is part of the IPFire Firewall. #
-# #
-# IPFire is free software; you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation; either version 2 of the License, or #
-# (at your option) any later version. #
-# #
-# IPFire is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with IPFire; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Copyright (C) 2014 IPFire Team <info@ipfire.org> #
-# #
-############################################################################
-
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+#
# This script checks if a daylight saving time transition
# has just happened and will run the given command.
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2018-2021 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
#!/bin/sh
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
perl -e "require '//var/ipfire/lang.pl'; &Lang::BuildCacheLang"
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2019 IPFire Development Team <info@ipfire.org> #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# Loop trough configured manual pages
foreach my $page (keys %manualpages) {
# Build absolute path and URL
- my $cgifile = "${basedir}/html/cgi-bin/${page}.cgi";
+ my $cgifile = "${basedir}/html/cgi-bin/${page}.cgi";
my $url = "${baseurl}/$manualpages{$page}";
-
+
print "${page}.cgi -> '$url'\n";
# Check CGI file exists
if($status != 200) {
die("ERROR: Received unexpected HTTP '$status'!\n");
}
-
+
print "SUCCESS: Received HTTP '$status'.\n";
}
open(FILE,">${basedir}/langs/$lang/cgi-bin/$lang.pl");
print FILE <<EOF;
-\%tr = (
+\%tr = (
\%tr,
EOF