| 1 | 1 | simandl | #!/usr/bin/env perl |
| 2 | | | |
| 3 | | | # $Id: setup.pl,v 1.8 2004/07/12 07:50:14 bernisys Exp $ |
| 4 | | | |
| 5 | | | # include PERL libraries |
| 6 | | | use strict; |
| 7 | | | use warnings; |
| 8 | | | use diagnostics; |
| 9 | | | |
| 10 | | | # include HotSaNIC libraries |
| 11 | | | use lib "../../lib"; |
| 12 | | | use lib "./platform"; |
| 13 | | | use HotSaNICparser; |
| 14 | | | |
| 15 | | | use HotSaNIClog; |
| 16 | | | use common; |
| 17 | | | |
| 18 | | | $|=1; |
| 19 | | | |
| 20 | | | (my $VERSION = '$Revision: 1.8 $') =~ s/.*(\d+\.\d+).*/$1/; |
| 21 | | | (my $IDENTIFIER = '$Id: setup.pl,v 1.8 2004/07/12 07:50:14 bernisys Exp $') =~ s/.*,v (.*) \$/$1/; |
| 22 | | | |
| 23 | | | my $MODNAME=HotSaNICparser::get_module_name(); |
| 24 | | | my %MODCONF=HotSaNICmod::common::configure(); |
| 25 | | | my $OUTFILE="settings.new"; |
| 26 | | | if ( ! -e "settings" ) { $OUTFILE="settings"; } |
| 27 | | | open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n"; |
| 28 | | | |
| 29 | | | if (@{$MODCONF{NETWORK}}) { $MODCONF{NETWORK}="NETWORK=\"".join("\"\nNETWORK=\"",@{$MODCONF{NETWORK}})."\""; } |
| 30 | | | else { $MODCONF{NETWORK}="NETWORK=\"other:*\"\nNETWORK=\"local:127.0.0.\""; } |
| 31 | | | |
| 32 | | | print OUTFILE "# SHORT DESCRIPTION |
| 33 | | | # |
| 34 | | | # first of all you have to configure the pathes to the dnet logfiles |
| 35 | | | # |
| 36 | | | # Example: |
| 37 | | | # |
| 38 | | | # LOGPATH=/var/log/rc5 |
| 39 | | | # LOGNAME_RC5=pproxyrc5 |
| 40 | | | # LOGNAME_DES=pproxydes |
| 41 | | | # LOGNAME_CSC=pproxycsc |
| 42 | | | # LOGNAME_OGR=pproxyogr |
| 43 | | | # |
| 44 | | | LOGPATH=\"$MODCONF{LOGPATH}\" |
| 45 | | | LOGNAME_RC5=\"$MODCONF{LOGNAME_RC5}\" |
| 46 | | | LOGNAME_DES=\"$MODCONF{LOGNAME_DES}\" |
| 47 | | | LOGNAME_CSC=\"$MODCONF{LOGNAME_CSC}\" |
| 48 | | | LOGNAME_OGR=\"$MODCONF{LOGNAME_OGR}\" |
| 49 | | | |
| 50 | | | # Then you may define one or more networks or hosts to be shown separately |
| 51 | | | # |
| 52 | | | # |
| 53 | | | # NETWORK=<name>:<network1>,<network2>, ... |
| 54 | | | # |
| 55 | | | # each network may be a single host or a network |
| 56 | | | # each network has to be terminated by a dot. |
| 57 | | | # |
| 58 | | | # ATTENTION! \"network\" means a network-address with the last |
| 59 | | | # part cleared out ... well let me give you a hint: |
| 60 | | | # 192.168.1. would be 192.168.1.0/24 |
| 61 | | | # 192.168. would be 192.168.0.0/16 |
| 62 | | | # |
| 63 | | | # sorry, but my module does not yet understand netmasks :( |
| 64 | | | # but i intend to edit the whole thing some day when time is my friend again... |
| 65 | | | # |
| 66 | | | # Example: |
| 67 | | | # |
| 68 | | | # NETWORK=other:* |
| 69 | | | # NETWORK=unknown_local:192.168.1. |
| 70 | | | # NETWORK=host1:192.168.1.1. |
| 71 | | | # NETWORK=host2:192.168.1.20. |
| 72 | | | # NETWORK=some_hosts:192.168.1.30.,192.168.1.31.,192.168.1.32. |
| 73 | | | # |
| 74 | | | $MODCONF{NETWORK} |
| 75 | | | "; |
| 76 | | | |
| 77 | | | close OUTFILE; |
| 78 | | | |
| 79 | | | if ($OUTFILE eq "settings.new") { |
| 80 | | | HotSaNICparser::backup_file("settings"); |
| 81 | | | rename "settings.new","settings"; |
| 82 | | | } |
| 83 | | | |
| 84 | | | print "Please check the settings file and adapt it to satisfy your needs.\n"; |
| 85 | | | |