2 * JIMCI (Jabber Instant Messaging Connection Interface)
3 * This file is part of JIMB.
5 * JIMCI is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License Version 3
7 * as published by the Free Software Foundation.
9 * JIMCI is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License Version 3
15 * along with JIMCI; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Author: Martin Kelm <martinkelm@idxsolutions.de>
29 gchar
*services_actions_exec
;
30 gchar
*services_actions_script
;
31 gchar
*services_updates_exec
;
32 gchar
*services_updates_script
;
33 extern gchar
*services_queue_message
;
35 gboolean
services_actions_perform(gpointer data
) {
36 gchar
*command
= g_strdup_printf("%s%s", services_actions_exec
, services_actions_script
);
38 debug("Services actions execution: %s", command
);
42 gboolean
services_updates_perform(gpointer data
) {
43 gchar
*command
= g_strdup_printf("%s%s", services_updates_exec
, services_updates_script
);
45 debug("Services updates execution: %s", command
);
50 char *actions_exec
, char *actions_script
, int actions_interval
,
51 char *updates_exec
, char *updates_script
, int updates_interval
, char *queue_message
53 if (strlen(queue_message
) > 0) {
54 services_queue_message
= queue_message
;
56 services_queue_message
= "";
58 if (strlen(actions_exec
) > 0 && actions_interval
> 0) {
59 if (strlen(actions_script
) > 0) {
60 services_actions_script
= g_strdup_printf(" %s", actions_script
);
62 services_actions_script
= "";
64 services_actions_exec
= actions_exec
;
65 gint func_ref_actions
= g_timeout_add(actions_interval
* 1000, services_actions_perform
, NULL
);
67 if (strlen(updates_exec
) > 0 && updates_interval
> 0) {
68 if (strlen(updates_script
) > 0) {
69 services_updates_script
= g_strdup_printf(" %s", updates_script
);
71 services_updates_script
= "";
73 services_updates_exec
= updates_exec
;
74 gint func_ref_updates
= g_timeout_add(updates_interval
* 1000, services_updates_perform
, NULL
);
77 debug("Services initialized");