 -    dst->set_target(src->target);
 - 
 -    return dst;   
--@@ -95,9 +106,12 @@
+-@@ -95,9 +104,12 @@
 - void free_runscript(RUNSCRIPT *script)
 - {
 -    Dmsg0(500, "runscript: freeing RUNSCRIPT object\n");

-    char level;                  /* Base|Full|Incr...|All (NYI) */
-    bool on_success;             /* execute command on job success (After) */
-    bool on_failure;             /* execute command on job failure (After) */
-@@ -85,8 +84,10 @@
-                                 /* Optional callback function passed to edit_job_code */
- 
-    bool run(JCR *job, const char *name=""); /* name must contain "Before" or "After" keyword */
-+   bool run_command(const char *cmd, JCR *job, const char *name="");
-    bool can_run_at_level(int JobLevel) { return true;};        /* TODO */
--   void set_command(const POOLMEM *cmd, int cmd_type = SHELL_CMD);
-+   void add_command(const POOLMEM *cmd, char cmd_type = SHELL_CMD);
-+   void get_command(const char *cmd, char *cmd_type, char **cmd);
-    void set_target(const POOLMEM *client_name);
-    void reset_default(bool free_string = false);
-    bool is_local();             /* true if running on local host */
-Index: src/lib/runscript.c
-===================================================================
---- src/lib/runscript.c	(rvision 6169)
-+++ src/lib/runscript.c	(copie de travail)
-@@ -59,15 +59,20 @@
- 
- void RUNSCRIPT::reset_default(bool free_strings)
- {

    }
    return 1;
 }
 
-bool RUNSCRIPT::is_local()
+bool RUNSCRIPT::is_local(const char *c)
 {
+   if (c[0] == CONSOLE_CMD) {
+      return true;
+   }
+
    if (!target || (strcmp(target, "") == 0)) {
       return true;
    } else {
@@ -175,23 +146,31 @@
    }
 }
 
