#!/usr/bin/perl
-# based on SmoothWall and IPCop CGIs
#
# This code is distributed under the terms of the GPL
-# Main idea from zeroconcept
-# ZERNINA-VERSION:0.9.4i
# (c) 2007 Ufuk Altinkaynak
#
print CONF "\n";
print CONF "daemon openvpnserver\n";
print CONF "writepid /var/run/openvpn.pid\n";
- print CONF "#DAN prepare ZERINA for listening on blue and orange\n";
+ print CONF "#DAN prepare OpenVPN for listening on blue and orange\n";
print CONF ";local $sovpnsettings{'VPN_IP'}\n";
print CONF "dev $sovpnsettings{'DDEVICE'}\n";
print CONF "$sovpnsettings{'DDEVICE'}-mtu $sovpnsettings{'DMTU'}\n";
} else {
$activeonrun = "disabled='disabled'";
}
- &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
- print "<div align='center'><strong>ZERINA-0.9.4i</strong></div>";
+ &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
print <<END
<table width='100%'>
<form method='post'>
#include "setuid.h"
#include "libsmooth.h"
-/*
- Version History
-
- 1.0.0.0 many things happend before ...
-
- 2.0.0.1 2005/06/09 tarralan
- add. Version History
- add. deleteChainReference(char*)
- add. createChainReference(char*)
- mod. deleteChain(char*)
- mod. flushChain(char*)
- add. flushAllChains()
- del. deletechains()
- add. consts for chain names
- del. createchains()
- add. createAllChains()
- add. ovpnInit()
- add. global vars for chain and interface status
- add. usage of consts for chain names
- mod. reworked createAllChains()
-
- 2.0.0.2 2005/06/09 horizont
- change the input + forward chain position index based on active interfaces
-
- 2.0.0.3 2005/06/09 tarralan
- mod. removed const attribute
-
- 2.0.0.4 2005/06/12 tarralan
- add. debug condition für output
- mod. changed definition auf consts
-
- 2.0.0.5-7 2005/06/12 tarralan
- debugging
-
- 2.0.0.8 2005/06/12 tarralan
- add. executeCommand()
-
- 2.0.0.9-16 2005/06/12 tarralan
- debugging
-
- 2.0.0.17 2005/06/12 tarralan
- mod. createAllChains
-
- 2.0.1.1 2005/06/12 tarralan
- non-debug build
-
- 2.0.1.2 2005/06/13 tarralan
- mod. some options renamed
-
- 2.0.1.3 2005/06/13 tarralan
- mod. startDaemon() to verify if OpenVPN is enabled
- mod. createAllChains() to verify if OpenVPN is enabled
- mod. command help
-
- 2.0.1.4 2005/06/13 tarralan
- mod. bug fixed with the -sdo option
- 2.0.1.5 2005/11/06 Ufuk Altinkaynak
- mod. bug fixed no need to read blue and orange dev, when they are not enabled
- 2.0.1.6 2005/01/03 Ufuk Altinkaynak
- mod. bug fixed reported by weizen_42 see http://www.vpnforum.de/viewtopic.php?p=7113#7113
-
-# ZERNINA-VERSION:0.9.0b
-# (c) 2005 tarralan + Ufuk Altinkaynak
-#
-# Ipcop and OpenVPN eas as one two three..
-#
-*/
#define noovpndebug
// global vars
printf(" -fwr --firewall-rules\n");
printf(" removes current OpenVPN chains and rules and resets them according to the config\n");
printf(" -sdo --start-daemon-only\n");
- printf(" starts OpenVPN daemon only (useful for rc.local)\n");
+ printf(" starts OpenVPN daemon only\n");
printf(" -ccr --create-chains-and-rules\n");
printf(" creates chains and rules for OpenVPN\n");
printf(" -dcr --delete-chains-and-rules\n");
executeCommand(command);
snprintf(command, STRING_SIZE - 1, "/bin/rm -f /var/run/openvpn.pid");
executeCommand(command);
+ executeCommand("modprobe -r tun");
}
void startDaemon(void) {
fprintf(stderr, "OpenVPN is not enabled on any interface\n");
exit(1);
} else {
+ executeCommand("modprobe tun");
snprintf(command, STRING_SIZE-1, "/usr/sbin/openvpn --config /var/ipfire/ovpn/server.conf");
executeCommand(command);
}
$file = "$server[2]/$getfile";
} else {
$host = $gethost;
+ $file = $getfile;
}
$proto = "HTTP" unless $proto;
my $ua = LWP::UserAgent->new;
$ua->agent("Pakfire/$Conf::version");
- #$ua->timeout(5);
+ $ua->timeout(5);
#$ua->env_proxy;
my $response = $ua->get("http://$host/$file");
@templine = split(/\;/,$line);
### filter here...
if ("$forweb" eq "forweb") {
- print "<option value=\"$templine[0]\">$templine[1]</option>\n";
+ print "<option value=\"$templine[0]\">$templine[0]-$templine[1]-$templine[2]</option>\n";
} else {
- print "$templine[0] $templine[1]\n";
+ print "Name: $templine[0]\nVersion: $templine[1]\nRelease: $templine[2]\n\n";
}
}
}
my $return = system("gpg -d < $Conf::cachedir/$file | tar xj -C $Conf::tmpdir/");
logger("Decryption process returned the following: $return");
- if ($return == 1) { exit 1; }
+ if ($return != 1) { exit 1; }
}
sub getpak {
exit 1;
}
- #message("\n## Downloading $file...");
-
unless ( "$force" eq "force" ) {
if ( -e "$Conf::cachedir/$file" ) {
return $file;
sub makeuuid {
unless ( -e "$Conf::dbdir/uuid" ) {
- message("Creating a random key...");
open(FILE, "</proc/sys/kernel/random/uuid");
my @line = <FILE>;
close(FILE);