]> git.sur5r.net Git - bacula/bacula/commitdiff
Add %h option in runscript to get client address
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 16 Feb 2011 13:06:13 +0000 (14:06 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:26 +0000 (14:43 +0200)
bacula/src/dird/dird_conf.c

index 3459351804df76617e75dea2dfb3b94249d41b22..8d37e7b68c5797ba46ac0ca5cc9808ca6b04722e 100644 (file)
@@ -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)