From: Eric Bollengier Date: Wed, 16 Feb 2011 13:06:13 +0000 (+0100) Subject: Add %h option in runscript to get client address X-Git-Tag: Release-7.0.0~1120 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b3622be992080760b3b1b830eae36e4aac05513e;p=bacula%2Fbacula Add %h option in runscript to get client address --- 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)