From afabe9f7d12f6c7fffeac86c63e9556e28471c02 Mon Sep 17 00:00:00 2001 From: ms Date: Mon, 18 Jun 2007 22:09:26 +0000 Subject: [PATCH] Kleine Fixes am Pakfire - brauche Binary. OpenVPN geht nach einem ersten Test... git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@638 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/packages/alsa | 1 + html/cgi-bin/ovpnmain.cgi | 8 +--- src/misc-progs/openvpnctrl.c | 71 ++-------------------------------- src/pakfire/lib/functions.pl | 12 +++--- src/pakfire/pakfire | 6 ++- 5 files changed, 15 insertions(+), 83 deletions(-) diff --git a/config/rootfiles/packages/alsa b/config/rootfiles/packages/alsa index fca4b03098..c6e850b527 100644 --- a/config/rootfiles/packages/alsa +++ b/config/rootfiles/packages/alsa @@ -1,3 +1,4 @@ +etc/rc.d/init.d/alsa usr/bin/aconnect usr/bin/alsamixer usr/bin/amidi diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 0b0d8cb088..7566ec00ae 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -1,9 +1,6 @@ #!/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 # @@ -301,7 +298,7 @@ sub writeserverconf { 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"; @@ -2558,8 +2555,7 @@ END } else { $activeonrun = "disabled='disabled'"; } - &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'}); - print "
ZERINA-0.9.4i
"; + &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'}); print <
diff --git a/src/misc-progs/openvpnctrl.c b/src/misc-progs/openvpnctrl.c index 96bc8d7802..028a1a3722 100644 --- a/src/misc-progs/openvpnctrl.c +++ b/src/misc-progs/openvpnctrl.c @@ -7,73 +7,6 @@ #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 @@ -121,7 +54,7 @@ void usage(void) 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"); @@ -363,6 +296,7 @@ void stopDaemon(void) { executeCommand(command); snprintf(command, STRING_SIZE - 1, "/bin/rm -f /var/run/openvpn.pid"); executeCommand(command); + executeCommand("modprobe -r tun"); } void startDaemon(void) { @@ -372,6 +306,7 @@ 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); } diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 48c34e9105..000b2cfc82 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -54,6 +54,7 @@ sub fetchfile { $file = "$server[2]/$getfile"; } else { $host = $gethost; + $file = $getfile; } $proto = "HTTP" unless $proto; @@ -62,7 +63,7 @@ sub fetchfile { 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"); @@ -189,9 +190,9 @@ sub dblist { @templine = split(/\;/,$line); ### filter here... if ("$forweb" eq "forweb") { - print "\n"; + print "\n"; } else { - print "$templine[0] $templine[1]\n"; + print "Name: $templine[0]\nVersion: $templine[1]\nRelease: $templine[2]\n\n"; } } } @@ -325,7 +326,7 @@ sub decryptpak { 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 { @@ -354,8 +355,6 @@ sub getpak { exit 1; } - #message("\n## Downloading $file..."); - unless ( "$force" eq "force" ) { if ( -e "$Conf::cachedir/$file" ) { return $file; @@ -451,7 +450,6 @@ sub beautifysize { sub makeuuid { unless ( -e "$Conf::dbdir/uuid" ) { - message("Creating a random key..."); open(FILE, "; close(FILE); diff --git a/src/pakfire/pakfire b/src/pakfire/pakfire index 94f8558eff..ef395df94c 100644 --- a/src/pakfire/pakfire +++ b/src/pakfire/pakfire @@ -4,7 +4,7 @@ my $interactive = 1; - &Pakfire::message("### Welcome to IPFire Pakfire $Conf::version!"); + &Pakfire::logger("### IPFire Pakfire $Conf::version started!"); ### Check if we are running as root # @@ -94,5 +94,7 @@ &Pakfire::makeuuid(); &Pakfire::senduuid(); &Pakfire::getmirrors(); - &Pakfire::dbgetlist(); + + } elsif ("$ARGV[0]" eq "list") { + &Pakfire::dblist("noweb"); } -- 2.39.2