From 9389781ddf491ad431dfad09d606b72ba2a50d62 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 96479d0121..46027bd86e 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -2061,11 +2061,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