$General::version = 'VERSION';
$General::swroot = 'CONFIG_ROOT';
$General::noipprefix = 'noipg-';
-$General::adminmanualurl = 'http://www.ipcop.org/1.4.0/en/admin/html';
+$General::adminmanualurl = 'http://users.ipfire.eu';
sub log
{
my $logmessage = $_[0];
$logmessage =~ /([\w\W]*)/;
$logmessage = $1;
- system('/usr/bin/logger', '-t', 'ipcop', $logmessage);
+ system('/usr/bin/logger', '-t', 'ipfire', $logmessage);
}
sub readhash
my ($out, $response) = Net::SSLeay::get_http( 'checkip.dyndns.org',
80,
"/",
- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' )
+ Net::SSLeay::make_headers('User-Agent' => 'IPFire' )
);
if ($response =~ m%HTTP/1\.. 200 OK%) {
$out =~ /Current IP Address: (\d+.\d+.\d+.\d+)/;
&showsubsection($menu);
print <<END
-
+ <p><center><img src="/images/iptux.png" width='160px' height='160px'></center></p>
</td>
<td width="100%" valign="top">
<div id="page-content">
UPDATE_VALUE=1
UPDATE_METHOD=manually
ENABLENTP=off
-NTP_ADDR_1=pool.ntp.org
+NTP_ADDR_1=de.pool.ntp.org
VALID=yes
# Log rotation
01 * * * * /usr/sbin/logrotate /etc/logrotate.conf
-# Backup logs to flashdisk
-01 * * * * [ -f "/etc/FLASH" ] && /etc/rc.d/rc.flash.down
-
# Set time
*/5 * * * * /usr/local/bin/timecheck > /dev/null 2>&1
<td class='base' width='25%'><img src='/blob.gif' align='top' alt='*' /> $Lang::tr{'this field may be blank'}</td>
<td class='base' width='30%'>$warnNTPmessage</td>
<td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/services.html#services_dhcp' target='_blank'>
- <img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
+ <td width='5%' align='right'> </td>
</tr>
</table>
</form>
<!-- Table of networks -->
<table border='0' width=80%>
- <!-- Headline -->
<tr> <th bgcolor='lightgrey'>$Lang::tr{'network'}
<th bgcolor='lightgrey'>IP
<th bgcolor='lightgrey'>$Lang::tr{'status'}
- <!-- RED -->
<tr> <td bgcolor='$Header::colourred' width='25%'><font size='2' color='white'><b>$Lang::tr{'internet'}:</b></font><br>
- <td width='30%'>$ipaddr <td width='45%'>$connstate
+ <td width='30%'>$ipaddr
+ <td width='45%'>$connstate
<tr><td colspan='2'>
<form method='post' action='/cgi-bin/dial.cgi'>$Lang::tr{'profile'}:
<select name='PROFILE'>
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; }
} else { print "Proxy aus"; }
}
- if (`ifconfig | grep $netsettings{'ORANGE_DEV'}`) { print <<END;
+ if ( $netsettings{'ORANGE_DEV'} ) { print <<END;
<tr><td bgcolor='$Header::colourorange' width='25%'><font size='2' color='white'><b>$Lang::tr{'dmz'}:</b></font><br>
<td width='30%'>$netsettings{'ORANGE_ADDRESS'}
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
}
- if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ) {
+ if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ||
+ `cat /var/ipfire/vpn/settings | grep ^ENABLED_BLUE=on` ) {
my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`;
print <<END;
<tr><td bgcolor='$Header::colourvpn' width='25%'><font size='2' color='white'><b>$Lang::tr{'vpn'}:</b></font><br>
}
}
print <<END
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/section-firewall.html#section-port-forwarding' target='_blank'>
- <img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
+ <td width='5%' align='right'> </td>
</tr>
</table>
END
<td width='30%' align='center'>
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
</td>
- <td width='10%' align='right'>
- <a href='${General::adminmanualurl}/system.html#shutdown' target='_blank'>
- <img src='/images/web-support.png' title='$Lang::tr{'online help en'}' /></a></td>
+ <td width='10%' align='right'>
</tr>
</table>
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
-require 'CONFIG_ROOT/general-functions.pl';
+require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
&Header::getcgihash(\%timesettings);
-if ($timesettings{'ACTION'} eq $Lang::tr{'instant update'})
-{
- if ($timesettings{'SETHOUR'} eq '' || $timesettings{'SETHOUR'} < 0 || $timesettings{'SETHOUR'} > 23) {
- $errormessage = $Lang::tr{'invalid time entered'};
- goto UPDTERROR;
- }
- if ($timesettings{'SETMINUTES'} eq '' || $timesettings{'SETMINUTES'} < 0 || $timesettings{'SETMINUTES'} > 59) {
- $errormessage = $Lang::tr{'invalid time entered'};
- goto UPDTERROR;
- }
- if ($timesettings{'SETDAY'} eq '' || $timesettings{'SETDAY'} < 1 || $timesettings{'SETDAY'} > 31) {
- $errormessage = $Lang::tr{'invalid date entered'};
- goto UPDTERROR;
- }
- if ($timesettings{'SETMONTH'} eq '' || $timesettings{'SETMONTH'} < 1 || $timesettings{'SETMONTH'} > 12) {
- $errormessage = $Lang::tr{'invalid date entered'};
- goto UPDTERROR;
- }
- if ($timesettings{'SETYEAR'} eq '' || $timesettings{'SETYEAR'} < 2003 || $timesettings{'SETYEAR'} > 2030) {
- $errormessage = $Lang::tr{'invalid date entered'};
- goto UPDTERROR;
- }
-
-UPDTERROR:
- if ($errormessage) {
- $timesettings{'VALID'} = 'no'; }
- else {
- $timesettings{'VALID'} = 'yes'; }
-
- if ($timesettings{'VALID'} eq 'yes') {
- # we want date in YYYY-MM-DD HH:MM format for date command
- # EAO changed datestring to ISO 6801 format 2003-08-11
- my $datestring = "$timesettings{'SETYEAR'}-$timesettings{'SETMONTH'}-$timesettings{'SETDAY'}";
- my $timestring = "$timesettings{'SETHOUR'}:$timesettings{'SETMINUTES'}";
- # EAO setdate.c also revised for ISO 6801 date format 2003-08-11
- system ('/usr/local/bin/setdate', $datestring, $timestring);
- &General::log("$Lang::tr{'time date manually reset'} $datestring $timestring");
- }
- unless ($errormessage) {
- undef %timesettings;
- }
-}
-
if ($timesettings{'ACTION'} eq $Lang::tr{'save'})
{
if ($timesettings{'ENABLENTP'} eq 'on')
if ($timesettings{'ACTION'} eq $Lang::tr{'set time now'} && $timesettings{'ENABLENTP'} eq 'on')
{
system ('/bin/touch', "${General::swroot}/time/settimenow");
+ system ('/usr/local/bin/timecheckctrl >& /dev/null');
}
&General::readhash("${General::swroot}/time/settings", \%timesettings);
$timesettings{'UPDATE_METHOD'} = 'manually';
$timesettings{'UPDATE_VALUE'} = '1';
$timesettings{'UPDATE_PERIOD'} = 'daily';
- $timesettings{'NTP_ADDR_1'} = 'pool.ntp.org';
+ $timesettings{'NTP_ADDR_1'} = 'de.pool.ntp.org';
$timesettings{'NTP_ADDR_2'} = 'pool.ntp.org';
}
<td width='30%'><img src='/blob.gif' alt='*' /> $Lang::tr{'this field may be blank'}</td>
<td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'set time now'}' /></td>
<td width='25%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/services.html#services_time' target='_blank'><img src='/images/web-support.png' title='$Lang::tr{'online help en'}' /></a>
- </td>
+ <td width='5%' align='right'> </td>
</tr>
</table>
END
&Header::closebox();
-&Header::openbox('100%', 'left', $Lang::tr{'update time'});
-
-print <<END
-<table width='100%'>
-<tr>
- <td width='65%' class='base'>
- <table>
- <tr>
- <td>$Lang::tr{'year'}: </td>
- <td><input type='text' name='SETYEAR' size='4' maxlength='4' value='$timesettings{'SETYEAR'}' /></td>
- <td> $Lang::tr{'month'}: </td>
- <td><input type='text' name='SETMONTH' size='2' maxlength='2' value='$timesettings{'SETMONTH'}' /></td>
- <td> $Lang::tr{'day'}: </td>
- <td><input type='text' name='SETDAY' size='2' maxlength='2' value='$timesettings{'SETDAY'}' /></td>
- <td> $Lang::tr{'hours2'}: </td>
- <td><input type='text' name='SETHOUR' size='2' maxlength='2' value='$timesettings{'SETHOUR'}' /></td>
- <td> $Lang::tr{'minutes'}: </td>
- <td><input type='text' name='SETMINUTES' size='2' maxlength='2' value='$timesettings{'SETMINUTES'}' /></td>
- </tr>
- </table>
- </td>
- <td width='35%' align='center' class='base'><input type='submit' name='ACTION' value='$Lang::tr{'instant update'}' /></td>
-</tr>
-</table>
-END
-;
-&Header::closebox();
-
print "</form>\n";
&Header::closebigbox();
<input type='hidden' name='ACTION' value='add' />
<input type='submit' name='SUBMIT' value='$buttontext' />
</td>
- <td width='5%' align='right'>
- <a href='${General::adminmanualurl}/section-firewall.html#section-blue-access' target='_blank'>
- <img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
+ <td width='5%' align='right'> </td>
</tr>
</table>
END
usr/local/bin/setreservedports
usr/local/bin/settime
usr/local/bin/timecheck
+usr/local/bin/timecheckctrl
#usr/local/bin/tunerrd.pl
-usr/local/bin/updatelists.pl
+#usr/local/bin/updatelists.pl
usr/local/bin/resetusb
#usr/local/doc
#usr/local/etc
ipfirebkcfg ipfirerscfg installpackage installfcdsl ipsecctrl \
setaliases ipfirebackup restartntpd \
restartapplejuice setdate rebuildhosts \
- restartsyslogd logwatch openvpnctrl
+ restartsyslogd logwatch openvpnctrl timecheckctrl
# restartwireless
install : all
ipsecctrl: ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+timecheckctrl: timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o
+ $(COMPILE) -I../install+setup/libsmooth/ timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
ipfirebackup: ipfirebackup.c setuid.o
$(COMPILE) -lcrypt ipfirebackup.c setuid.o -o $@
--- /dev/null
+/* SmoothWall helper program - smoothiedeath
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence. See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Simple program intended to be installed setuid(0) that can be used for
+ * starting shutdown.
+ *
+ * $Id: ipcopdeath.c,v 1.2 2003/12/11 10:57:34 riddles Exp $
+ *
+ */
+
+#include <stdlib.h>
+#include "setuid.h"
+
+int main(void)
+{
+ if (!(initsetuid()))
+ exit(1);
+
+ safe_system("/usr/local/bin/timecheck");
+
+ return 0;
+}
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t $tr{'cpu usage per'} $tr{$period}",
"DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
"DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t $tr{'memory usage per'} $tr{$period}",
"DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
"DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t $tr{'swap usage per'} $tr{$period}",
"DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
"DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t $tr{'disk access per'} $tr{$period}",
"DEF:read=$rrdlog/disk.rrd:readsect:AVERAGE",
"DEF:write=$rrdlog/disk.rrd:writesect:AVERAGE",
"--alt-y-grid", "-w 600", "-h 100",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
"-v$tr{'bytes per second'}",
"DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
"--alt-y-grid", "-w 600", "-h 200",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t firewall hits over the last $interval",
"DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
"AREA:amount#6464FF:firewallhits",
"--alt-y-grid", "-w 600", "-h 200",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-t firewall hits over the last $interval",
"DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
"LINE2:amount#6464FF:firewallhits",
"--lazy",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
- "--color", "BACK#EAE9EE",
+ "--color", "BACK#FFFFFF",
"-v ms / pkts (% x10)",
"DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE",
"DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE",
+++ /dev/null
-#!/usr/bin/perl\r
-\r
-use strict;\r
-use LWP::UserAgent;\r
-require "CONFIG_ROOT/general-functions.pl";\r
-\r
-my @this;\r
-my $return = &downloadlist();\r
-if($return && $return->is_success) {\r
- unless(open(LIST, ">CONFIG_ROOT/patches/available")) {\r
- die "Could not open available lists database.";\r
- }\r
- flock LIST, 2;\r
- @this = split(/----START LIST----\n/,$return->content);\r
- print LIST $this[1];\r
- close(LIST);\r
-} else {\r
- die "Could not download patches list.";\r
-}\r
-\r
-sub downloadlist {\r
- unless(-e "CONFIG_ROOT/red/active") {\r
- die "Not connected.";\r
- }\r
-\r
- my $downloader = LWP::UserAgent->new;\r
- $downloader->timeout(5);\r
-\r
- my %proxysettings;\r
- &General::readhash("CONFIG_ROOT/proxy/settings", \%proxysettings);\r
-\r
- if ($_=$proxysettings{'UPSTREAM_PROXY'}) {\r
- my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);\r
- if ($proxysettings{'UPSTREAM_USER'}) {\r
- $downloader->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$peer:$peerport/");\r
- } else {\r
- $downloader->proxy("http","http://$peer:$peerport/");\r
- }\r
- }\r
-\r
- return $downloader->get("http://www.ipcop.org/patches/${General::version}", 'Cache-Control', 'no-cache');\r
-}\r
+++ /dev/null
-#!/bin/bash
-
-UPGRADEVERSION="1.4.x" # configured by ./make.sh newupdate
-PREVIOUSVERSION="1.4."$((`echo $UPGRADEVERSION | /usr/bin/cut -f3 -d '.'`-1))
-echo "This is the $UPGRADEVERSION update patch for IPCop $PREVIOUSVERSION installing."
-
-CURRENTVERSION=`perl -e "require '/var/ipfire/general-functions.pl';print \\$General::version;"`
-if [ "$CURRENTVERSION" != "$PREVIOUSVERSION" ]; then
- echo "You are not running IPCop v$PREVIOUSVERSION for this patch to install."
- echo "Aborting installation."
- exit -1
-fi
-
-# general-functions might not be overwrited by patch...
-/bin/sed -i -e "s+= '1.4.*$+= '$UPGRADEVERSION';+" /var/ipfire/general-functions.pl
-
-/bin/tar -zxpf patch.tar.gz -C /
-
-#build cachelang file after all "lang/*.pl" updates
-perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
-
-killall mingetty #redisplay correct version
-echo "end of $UPGRADEVERSION update"