]> 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)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Feb 2011 17:56:32 +0000 (18:56 +0100)
bacula/src/dird/dird_conf.c

index 96479d0121dd1fd34a3eccb63c620baf1366b66a..46027bd86e928f58b2c9da16aaff6b9384784db7 100644 (file)
@@ -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)