summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY4
-rw-r--r--README11
-rw-r--r--dynamicdevice.c7
-rw-r--r--dynamite.c2
4 files changed, 23 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 67092c1..fced718 100644
--- a/HISTORY
+++ b/HISTORY
@@ -227,3 +227,7 @@ VDR Plugin 'dynamite' Revision History
- add udev attribute "dynamite_attach_delay" for delaying the attach of specific devices
useful for device if the firmware upload needs some time
+
+2011-12-15: Version 0.0.8j
+
+- add attach-hook, argument is --device=/dev/path
diff --git a/README b/README
index 34c2761..5dd54e2 100644
--- a/README
+++ b/README
@@ -216,6 +216,7 @@ Parameters in setup.conf
dynamite.DefaultGetTSTimeout = 0
dynamite.GetTSTimeoutHandler = /path/to/program
dynamite.FreeDeviceSlots = 0
+dynamite.AttachHook = /path/to/program
dynamite.IdleHook = /path/to/program
dynamite.IdleTimeout = 0
dynamite.IdleWakeup = 0
@@ -233,6 +234,8 @@ Commandline Arguments
-f, --free-device-slots=n
leave n slots free for non-dynamic devices of
incompatible plugins
+-a, --attach-hook=/path/to/program
+ set program to be called on device attach
-i, --idle-hook=/path/to/program
set program to be called on SetIdle and reactivation
-I, --idle-timeout=m
@@ -240,6 +243,14 @@ Commandline Arguments
-W, --idle-wakeup=h
if a device is idle for h hours wake it up (e.g. for EPG scan)
+Attach hook
+-----------
+If you want 'special action' taken after a device is attached to vdr
+you can specify a program either with the commandline parameter
+"--attach-hook=/path/to/program" or with an entry in the setup.conf
+dynamite.AttachHook = /path/to/program
+It will be called with the parameter "--device=/dev/path".
+
Idle mode
---------
A device with no active receiver can be set to "idle". Classes derived
diff --git a/dynamicdevice.c b/dynamicdevice.c
index c694313..0567a57 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -284,6 +284,13 @@ attach:
Skins.QueueMessage(mtInfo, *osdMsg);
}
cDynamiteStatus::SetStartupChannel();
+ if (attachHook != NULL) {
+ cString hookCmd = cString::sprintf("%s --device=%s", **attachHook, DevPath);
+ isyslog("dynamite: calling attach hook %s", *hookCmd);
+ int status = SystemExec(*hookCmd, true);
+ if (!WIFEXITED(status) || WEXITSTATUS(status))
+ esyslog("SystemExec() failed with status %d", status);
+ }
return ddrcSuccess;
}
diff --git a/dynamite.c b/dynamite.c
index 68c6dad..fb2d3b6 100644
--- a/dynamite.c
+++ b/dynamite.c
@@ -11,7 +11,7 @@
#include "monitor.h"
#include "status.h"
-static const char *VERSION = "0.0.8i";
+static const char *VERSION = "0.0.8j";
static const char *DESCRIPTION = tr("attach/detach devices on the fly");
static const char *MAINMENUENTRY = NULL;