PKGBUILDs/community/system-tools-backends/Services.patch
2009-10-09 21:15:33 -05:00

36 lines
1 KiB
Diff

--- Init/Services.pm.old 2007-09-26 01:43:27.000000000 +0200
+++ Init/Services.pm 2007-10-20 18:08:52.000000000 +0200
@@ -979,21 +979,26 @@
my $rcconf = '/etc/rc.conf';
my ($daemons);
$daemons = &Utils::Parse::get_sh ($rcconf, "DAEMONS");
- $daemons =~ s/[()]//;
-
- if (($daemons =~ m/$script/) && !$active)
+ $daemons =~ s/[\(\)]//g;
+ $script=~s/([\\\.\^\$\*\+\?\{\}\[\]\(\)\|])/\\\1/g;
+ $notscript="\!".$script;
+ if (($daemons =~ m/$notscript/) && $active)
+ {
+ $daemons =~ s/$notscript/$script/g;
+ }
+ elsif (($daemons =~ m/$script/) && !$active)
{
- $daemons =~ s/$script[ \t]*//;
+ $daemons =~ s/$script/$notscript/g;
}
elsif (($daemons !~ m/$script/) && $active)
{
- $daemons =~ s/network/network $script/g;
+ $daemons .= " ".$script;
}
-
- &Utils::Replace::set_sh ($rcconf, "DAEMONS", "($daemons)", 1);
+ &Utils::Replace::set_sh_array ($rcconf, "DAEMONS", $daemons);
&run_rcng_script ($service, ($active) ? "start" : "stop");
}
+
sub set_rcng_services
{
my ($services) = @_;