include the date and module version in the generated init file
This commit is contained in:
parent
f5923e7327
commit
db10ca03e9
4 changed files with 23 additions and 12 deletions
3
Changes
3
Changes
|
@ -1,3 +1,6 @@
|
|||
* include the date and module version in the generated init file
|
||||
(Karen Etheridge)
|
||||
|
||||
0.0.9 2012-19-04 SymKat <symkat@symkat.com>
|
||||
* Stole Moo's MANIFEST.SKIP
|
||||
|
||||
|
|
|
@ -374,6 +374,8 @@ sub dump_init_script {
|
|||
$self->data( $self->run_template(
|
||||
$self->data,
|
||||
{
|
||||
HEADER => 'Generated at ' . scalar(localtime)
|
||||
. ' with Daemon::Control ' . ($self->VERSION || 'DEV'),
|
||||
NAME => $self->name ? $self->name : "",
|
||||
REQUIRED_START => $self->lsb_start ? $self->lsb_start : "",
|
||||
REQUIRED_STOP => $self->lsb_stop ? $self->lsb_stop : "",
|
||||
|
@ -427,6 +429,8 @@ sub run {
|
|||
__DATA__
|
||||
#!/bin/sh
|
||||
|
||||
# [% HEADER %]
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: [% NAME %]
|
||||
# Required-Start: [% REQUIRED_START %]
|
||||
|
|
|
@ -24,17 +24,19 @@ close $lf;
|
|||
|
||||
my $content_expected = do { local $/; <DATA> };
|
||||
|
||||
is $content, $content_expected, "LSB File Generation Works.";
|
||||
like $content, qr/$content_expected/, "LSB File Generation Works.";
|
||||
|
||||
done_testing;
|
||||
|
||||
__DATA__
|
||||
#!/bin/sh
|
||||
|
||||
# Generated at [\w: ]+ with Daemon::Control (?:DEV|[\d.]+)
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: My Daemon
|
||||
# Required-Start: $syslog $remote_fs
|
||||
# Required-Stop: $syslog
|
||||
# Required-Start: \$syslog \$remote_fs
|
||||
# Required-Stop: \$syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: My Daemon Short
|
||||
|
@ -43,9 +45,9 @@ __DATA__
|
|||
|
||||
|
||||
|
||||
if [ -x /usr/sbin/mydaemon/init.pl ];
|
||||
if \[ -x /usr/sbin/mydaemon/init.pl \];
|
||||
then
|
||||
/usr/sbin/mydaemon/init.pl $1
|
||||
/usr/sbin/mydaemon/init.pl \$1
|
||||
else
|
||||
echo "Required program /usr/sbin/mydaemon/init.pl not found!"
|
||||
exit 1;
|
||||
|
|
|
@ -24,28 +24,30 @@ close $lf;
|
|||
|
||||
my $content_expected = do { local $/; <DATA> };
|
||||
|
||||
is $content, $content_expected, "LSB File Generation Works.";
|
||||
like $content, qr/$content_expected/, "LSB File Generation Works.";
|
||||
|
||||
done_testing;
|
||||
|
||||
__DATA__
|
||||
#!/bin/sh
|
||||
|
||||
# Generated at [\w: ]+ with Daemon::Control (?:DEV|[\d.]+)
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: My Daemon
|
||||
# Required-Start: $syslog $remote_fs
|
||||
# Required-Stop: $syslog
|
||||
# Required-Start: \$syslog \$remote_fs
|
||||
# Required-Stop: \$syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: My Daemon Short
|
||||
# Description: My Daemon controls the My Daemon daemon.
|
||||
### END INIT INFO`
|
||||
|
||||
[ -r /etc/default/my_program ] && . /etc/default/my_program
|
||||
\[ -r /etc/default/my_program \] && . /etc/default/my_program
|
||||
|
||||
if [ -x /usr/sbin/mydaemon/init.pl ];
|
||||
if \[ -x /usr/sbin/mydaemon/init.pl \];
|
||||
then
|
||||
/usr/sbin/mydaemon/init.pl $1
|
||||
/usr/sbin/mydaemon/init.pl \$1
|
||||
else
|
||||
echo "Required program /usr/sbin/mydaemon/init.pl not found!"
|
||||
exit 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue