aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugin_raspi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin_raspi.c b/plugin_raspi.c
index c6e7e45..5932d08 100644
--- a/plugin_raspi.c
+++ b/plugin_raspi.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at>
* Copyright (C) 2013 Volker Gerng <v.gering@t-online.de>
+ * Copyright (C) 2013 Jonathan McCrohan <jmccrohan@gmail.com>
* Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
*
* This file is part of LCD4Linux.
@@ -39,6 +40,7 @@
/* these should always be included */
#include "debug.h"
#include "plugin.h"
+#include "cfg.h"
#include <stdlib.h>
#include <stdio.h>
@@ -64,6 +66,8 @@
#define strings(a, b) "_cat(a,b)"
+static char Section[] = "Plugin:raspi";
+static int plugin_enabled;
char tmpstr[128];
@@ -132,6 +136,17 @@ static void my_cputemp(RESULT * result)
/* MUST NOT be declared 'static'! */
int plugin_init_raspi(void)
{
+ /* Check if raspi plugin section exists in config file */
+ if (cfg_number(Section, "enabled", 0, 0, 1, &plugin_enabled) < 1) {
+ plugin_enabled = 0;
+ }
+
+ /* Disable plugin unless it is explicitly enabled */
+ if (plugin_enabled != 1) {
+ info("[raspi] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)");
+ return 0;
+ }
+
char checkFile[128];
snprintf(checkFile, sizeof(checkFile), "%s%s", RASPI_TEMP_PATH, RASPI_TEMP_IDFILE);
ebian/changelog?h=debian/0%2bgit20151202.3864e0a-1&id=199e3529a4e095c4a9974199ef5e9042e77e1e78&follow=1'>New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9