Config::Inetd - Interface inetd's configuration file
use Config::Inetd;
$inetd = Config::Inetd->new;
if ($inetd->is_enabled(telnet => 'tcp')) { $inetd->disable(telnet => 'tcp'); }
print $inetd->dump_enabled; print $inetd->dump_disabled;
print $inetd->{CONF}[6];
Config::Inetd is an interface to inetd's configuration file inetd.conf;
it simplifies checking and setting the enabled/disabled state of services
and dumping them by their state.
$inetd = Config::Inetd->new('/path/to/inetd.conf');
Omitting the path to inetd.conf, will cause the default /etc/inetd.conf to be used.
Checks whether a service is enlisted as enabled.
$inetd->is_enabled($service => $protocol);
Returns 1 if the service is enlisted as enabled, 0 if enlisted as disabled, undef if the service does not exist.
Enables a service.
$inetd->enable($service => $protocol);
Returns 1 if the service has been enabled, 0 if no action has been taken.
It is recommended to preceedingly run is_enabled() to determine whether a
service is disabled.
Disables a service.
$inetd->disable($service => $protocol);
Returns 1 if the service has been disabled, 0 if no action has been taken.
It is recommended to preceedingly run is_enabled() to determine whether a
service is enabled.
Dumps the enabled services.
@dump = $inetd->dump_enabled;
Returns an array that consists of inetd configuration lines which are enabled services.
Dumps the disabled services.
@dump = $inetd->dump_disabled;
Returns an array that consists of inetd configuration lines which are disabled services.
The inetd configuration file is tied as instance data (newlines are preserved);
it may be accessed via @{$inetd->{CONF}}.
the Tie::File manpage, inetd(8)
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.