From 17e21ea9f8bbdb7d5b3d831b1e8b37089e0ac4fa Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 16 Feb 2011 14:06:13 +0100 Subject: [PATCH] Add %h option in runscript to get client address --- bacula/src/dird/dird_conf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 3459351804..8d37e7b68c 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -2051,11 +2051,13 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) /* callback function for edit_job_codes */ extern "C" char *job_code_callback_filesetname(JCR *jcr, const char* param) { - if (param[0] == 'f') { + if (param[0] == 'f' && jcr->fileset) { return jcr->fileset->name(); - } else { - return NULL; - } + + } else if (param[0] == 'h' && jcr->client) { + return jcr->client->address; + } + return NULL; } bool parse_dir_config(CONFIG *config, const char *configfile, int exit_code) -- 2.39.5