NAME
Net::Inetd - An interface to inetd.conf
SYNOPSIS
use Net::Inetd;
$Inetd = Net::Inetd->new;
if ($Inetd->is_enabled(telnet => 'tcp')) {
$Inetd->disable(telnet => 'tcp');
}
print $Inetd->{CONF}[6];
$, = "\n";
print @{$Inetd->dump_enabled};
DESCRIPTION
Net::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.
METHODS
new
Object constructor.
$Inetd = Net::Inetd->new('./inetd.conf');
Omitting the path to inetd.conf, will cause the default /etc/inetd.conf to be used.
is_enabled
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.
enable
Enables a service.
$Inetd->enable($service => $protocol);
Returns 1 if the service has been enabled, 0 if no action has been taken.
disable
Disables a service.
$Inetd->disable($service => $protocol);
Returns 1 if the service has been disabled, 0 if no action has been taken.
dump_enabled
Dumps the enabled services.
$dumpref = $Inetd->dump_enabled;
Returns an arrayref that consists of inetd.conf lines which contain enabled services.
dump_disabled
Dumps the disabled services.
$dumpref = $Inetd->dump_disabled;
Returns an arrayref that consists of inetd.conf lines which contain disabled services.
INSTANCE DATA
The inetd.conf configuration is tied as instance data; it may be accessed by @{$Inetd->{CONF}}.
SEE ALSO
Tie::File, inetd(8)