     alist **runscripts = (alist **)(item->value) ;
  
     Dmsg1(200, "store_runscript: begin store_runscript pass=%i\n", pass);
-@@ -1846,6 +1852,11 @@
+@@ -1887,6 +1892,10 @@
        scan_err1(lc, _("Expecting open brace. Got %s"), lc->str);
     }
     
 +   if (pass == 2) {
-+      res_runscript_cmd = New(alist(10, not_owned_by_alist));
-+      res_runscript_type = New(alist(10, not_owned_by_alist));
++      res_runscript.commands = New(alist(10, not_owned_by_alist));
 +   }
 +
     while ((token = lex_get_token(lc, T_SKIP_EOL)) != T_EOF) {
        if (token == T_EOB) {
          break;
-@@ -1873,26 +1884,26 @@
+@@ -1914,26 +1923,25 @@
     }
  
     if (pass == 2) {

-      
-      (*runscripts)->append(script);
-      script->debug();
+      while ((c=(char*)res_runscript_cmd->pop()) != NULL) {
+         t = (int) res_runscript_type->pop();
+         RUNSCRIPT *script = new_runscript();
+         memcpy(script, &res_runscript, sizeof(RUNSCRIPT));
+         script->set_job_code_callback(job_code_callback_filesetname);
+         script->command = c;
+         script->cmd_type = t;
+
+         (*runscripts)->append(script);
+         script->debug();
+      }
+      delete res_runscript_type;
+      delete res_runscript_cmd;
    }
 
    scan_to_eol(lc);

Index: src/dird/dird_conf.c
===================================================================
--- src/dird/dird_conf.c	(rvision 6586)
+++ src/dird/dird_conf.c	(copie de travail)
@@ -1772,7 +1772,11 @@
    lex_get_token(lc, T_STRING);
 
    if (pass == 2) {
-      ((RUNSCRIPT*)item->value)->set_command(lc->str, item->code);
+      Dmsg2(1, "runscript cmd=%s type=%c\n", lc->str, item->code);
+      POOLMEM *c = get_pool_memory(PM_FNAME);
+      pm_strcpy(c, lc->str);
+      ((RUNSCRIPT*) item->value)->commands->prepend(c);
+      ((RUNSCRIPT*) item->value)->commands->prepend((void *)item->code);
    }
    scan_to_eol(lc);
 }
@@ -1874,7 +1878,8 @@
  */
 static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
 {
