diff options
| -rw-r--r-- | HISTORY | 4 | ||||
| -rw-r--r-- | README | 11 | ||||
| -rw-r--r-- | dynamicdevice.c | 7 | ||||
| -rw-r--r-- | dynamite.c | 2 | 
4 files changed, 23 insertions, 1 deletions
| @@ -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 @@ -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;  } @@ -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; | 
