 +   return 1;
 +}
 +
++/* run a command from the list */
 +bool RUNSCRIPT::run_command(const char *command, JCR *jcr, const char *name)
 +{
     POOLMEM *ecmd = get_pool_memory(PM_FNAME);
-    int status;
+-   int status;
++   int status, cmd_type;
     BPIPE *bpipe;
-    char line[MAXSTRING];
-+   char cmd_type;
-+   char *cmd;
+-   char line[MAXSTRING];
++   char line[MAXSTRING], *cmd;
  
 -   ecmd = edit_job_codes(jcr, ecmd, this->command, "", this->job_code_callback);
 -   Dmsg1(100, "runscript: running '%s'...\n", ecmd);

+   commands->append(c);
 }
 
+void RUNSCRIPT::get_command(const char* command, char *acmd_type, char **cmd)
+{
+   *acmd_type = command[0];
+   *cmd = (char *)command + 1;
+}
+
 /* set this->target to client_name */
 void RUNSCRIPT::set_target(const POOLMEM *client_name)
 {
@@ -210,14 +186,71 @@
 
 bool RUNSCRIPT::run(JCR *jcr, const char *name)
 {

          scan_err2(lc, _("%s item is required in %s resource, but not found.\n"),
                    "command", "runscript");
       }
@@ -1886,7 +1889,7 @@
       RUNSCRIPT *script = new_runscript();
       memcpy(script, &res_runscript, sizeof(RUNSCRIPT));
       script->set_job_code_callback(job_code_callback_filesetname);
-      
+
