summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhomepanel-control9
-rw-r--r--homepanel.initd27
2 files changed, 33 insertions, 3 deletions
diff --git a/homepanel-control b/homepanel-control
index 0017c13..5bc877a 100755
--- a/homepanel-control
+++ b/homepanel-control
@@ -4,17 +4,20 @@ use warnings;
use Daemon::Control;
use Path::Tiny;
-my $basedir = path(__FILE__)->parent;
+my $basedir = path(__FILE__)->parent->realpath;
exit Daemon::Control->new(
- init_config => '/data/perl5/etc/bashrc',
+ init_code => <<'INIT',
+export PERLBREW_ROOT=/data/perl5
+. /data/perl5/etc/bashrc
+INIT
name => "HomePanel",
lsb_start => '$local_fs $network $named $time',
lsb_stop => '$local_fs $network $named $time',
lsb_sdesc => 'Home info panel',
lsb_desc => 'Show forecast, tube, bus status.',
- path => __FILE__,
+ path => path(__FILE__)->realpath,
program => $basedir->child('driver-async.pl'),
program_args => [ $basedir->child('homepanel.conf') ],
diff --git a/homepanel.initd b/homepanel.initd
new file mode 100644
index 0000000..32ded00
--- /dev/null
+++ b/homepanel.initd
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Generated at Sat Oct 18 11:38:22 2014 with Daemon::Control 0.001006
+
+### BEGIN INIT INFO
+# Provides: HomePanel
+# Required-Start: $local_fs $network $named $time
+# Required-Stop: $local_fs $network $named $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Home info panel
+# Description: Show forecast, tube, bus status.
+### END INIT INFO`
+
+
+
+export PERLBREW_ROOT=/data/perl5
+. /data/perl5/etc/bashrc
+
+
+if [ -x /home/dakkar/src/HomePanel/homepanel-control ];
+then
+ /home/dakkar/src/HomePanel/homepanel-control $1
+else
+ echo "Required program /home/dakkar/src/HomePanel/homepanel-control not found!"
+ exit 1;
+fi