Hallo,
um ein externe Script zu starten und dafür ein Menüeintrag im VDR zu haben habe ich mir ein kleines Plugin mit Hilfe des "newplugin" in der VDR Source erstellt.
Durch cut and copy habe ich mir aus einem anderen Plugin die paar folgenden Zeilen abgeschaut:
C
/*
* myscript.c: A plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
* $Id$
*/
#include <vdr/plugin.h>
static const char *VERSION = "0.0.1";
static const char *DESCRIPTION = "Start myscript.sh in PluginDir";
static const char *MAINMENUENTRY = "Myscript";
class cPluginMyscript : public cPlugin {
......
cOsdObject *cPluginMyscript::MainMenuAction(void)
{
// Perform the action when selected from the main VDR menu.
char cmd[300];
char scriptdir[200];
strcpy(scriptdir, cPlugin::ConfigDirectory());
strcat(scriptdir, "/myscript");
sprintf(cmd, "%s/myscript.sh", scriptdir);
dsyslog("Execute %s/myscript.sh", scriptdir);
system (cmd);
return NULL;
}
....
Alles anzeigen
Es funktioniert auch soweit (im Script starte ich allerdings die andere Anwendung per "| at now" um nicht im VDR Prozess zu hängen), ich frage mich jetzt nur ob das so ok ist oder ob es evtl. noch besser geht ???
Gruß,
Chuck