diff options
author | Peter Palfrader <peter@palfrader.org> | 2004-11-14 22:34:20 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2004-11-14 22:34:20 +0000 |
commit | da03613b37f02bca8a3960b34a56f0d25470185a (patch) | |
tree | b72fa26ff8e607b0b8e76a04bfb69f9a2d7e4aac /debian/echolot.config | |
parent | 716a492f46e41548947f7fd9b8a172279edc8426 (diff) |
remove debconf stuff
Diffstat (limited to 'debian/echolot.config')
-rwxr-xr-x | debian/echolot.config | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/debian/echolot.config b/debian/echolot.config deleted file mode 100755 index 16d5f76..0000000 --- a/debian/echolot.config +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/perl -w - -use strict; - -use Debconf::Client::ConfModule; -use English; - -my $address; -my $operator; -my $sitename; -my $recipient_delimiter; - -if ( -e '/etc/echolot/pingd.conf' ) { - my $CONFIG; - { - local $/ = undef; - open(CONFIGCODE, '/etc/echolot/pingd.conf') or - die ("Cannot open /etc/echolot/pingd.conf: $!"); - my $config_code = <CONFIGCODE>; - close (CONFIGCODE); - ($config_code) = $config_code =~ /^(.*)$/s; - eval ($config_code); - ($EVAL_ERROR) and - die("Evaling config code from /etc/echolot/pingd.conf returned error: $EVAL_ERROR"); - } - - $address = $CONFIG->{'my_localpart'}.'@'.$CONFIG->{'my_domain'} if (defined $CONFIG->{'my_localpart'} && defined $CONFIG->{'my_domain'}); - $operator = $CONFIG->{'operator_address'} if (defined $CONFIG->{'operator_address'}); - $sitename = $CONFIG->{'sitename'} if (defined $CONFIG->{'sitename'}); - $recipient_delimiter = $CONFIG->{'recipient_delimiter'} if (defined $CONFIG->{'recipient_delimiter'}); -}; - -my $mailname; -$mailname = `cat /etc/mailname` if ( -e '/etc/mailname' ); -$mailname = `hostname` unless ( defined $mailname ); -$mailname = 'example.org' unless ( defined $mailname ); -chomp $mailname; - -$address = 'echolot@'.$mailname unless defined $address; -$operator = 'abuse@'.$mailname unless defined $operator; -$sitename = $mailname unless defined $sitename; -$recipient_delimiter = '' unless defined $recipient_delimiter; - -Debconf::Client::ConfModule::set('echolot/address', $address); -Debconf::Client::ConfModule::set('echolot/operator', $operator); -Debconf::Client::ConfModule::set('echolot/sitename', $sitename); -Debconf::Client::ConfModule::set('echolot/recipient_delimiter', $recipient_delimiter); - - -my $state = 1; -my $numerr = 0; - -Debconf::Client::ConfModule::version('2.0'); -Debconf::Client::ConfModule::capb('backup'); -while (1) { - if ($state == 0) { - $state = 1; - } elsif ($state == 1) { - Debconf::Client::ConfModule::input('high', 'echolot/address'); - my @return = Debconf::Client::ConfModule::go(); - - $address = Debconf::Client::ConfModule::get('echolot/address'); - unless ($address =~ /@/) { - $address .= '@'.$mailname; - Debconf::Client::ConfModule::set('echolot/address', $address); - $numerr++; - next if ($numerr <= 5); - }; - - if ($return[0] == 30) { - $numerr = 0; - $state--; - } else { - $numerr = 0; - $state++; - }; - next; - } elsif ($state == 2) { - Debconf::Client::ConfModule::input('high', 'echolot/operator'); - Debconf::Client::ConfModule::input('high', 'echolot/sitename'); - Debconf::Client::ConfModule::input('high', 'echolot/recipient_delimiter'); - Debconf::Client::ConfModule::input('medium', 'echolot/addnow'); - } elsif ($state == 3) { - last; - } else { - die ("Unknown state $state"); - }; - - my @return = Debconf::Client::ConfModule::go(); - if ($return[0] == 30) { - $state--; - } else { - $state++; - }; -}; - -# vim:set ts=4: -# vim:set shiftwidth=4: |