diff options
Diffstat (limited to 'pcr/initify/trim_path_from_service_name.patch')
-rw-r--r-- | pcr/initify/trim_path_from_service_name.patch | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/pcr/initify/trim_path_from_service_name.patch b/pcr/initify/trim_path_from_service_name.patch index dea81a249..f1aef74bd 100644 --- a/pcr/initify/trim_path_from_service_name.patch +++ b/pcr/initify/trim_path_from_service_name.patch @@ -1,13 +1,32 @@ diff --git a/initify.pl b/initify.pl -index 7cec3d2..3accde8 100755 +index 7cec3d2..3d8b1bd 100755 --- a/initify.pl +++ b/initify.pl -@@ -14,7 +14,7 @@ my @cmds_start = (); +@@ -14,7 +14,8 @@ my @cmds_start = (); my @cmds_stop = (); my $pidfile = ""; my $desc = ""; -(my $service=$ARGV[0])=~s/\.service//; -+(my $service=$ARGV[0])=~s|(.*/)?([^/.]*)\.service|$2|; ++(my $service = $ARGV[0]) =~ s/\.service//; ++(my $svc_name = $ARGV[0]) =~ s|(.*/)?([^/.]*)\.service|$2|; my %opt; GetOptions(\%opt, +@@ -23,7 +24,7 @@ GetOptions(\%opt, + + pod2usage() if ($opt{help}); + +-$service = $opt{name} if (length $opt{name}); ++$svc_name = $opt{name} if (length $opt{name}); + + while(<>) { + #s/\s*|\s*$//g; # Trim whitespace +@@ -77,7 +78,7 @@ command=$cmd_path[0] + command_args="$cmd_argl[0]" + pidfile=$pidfile + +-name="$service" ++name="$svc_name" + description="$desc" + EOF + |