]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix runscript on director
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 3 Nov 2006 14:14:00 +0000 (14:14 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 3 Nov 2006 14:14:00 +0000 (14:14 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3597 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird_conf.c

index 520d133cc917f47d9666683049c8891ba99ba4b7..ae3f975850051499907d59ce8815b70fb6cfb32e 100644 (file)
@@ -1598,7 +1598,7 @@ static void store_runscript_target(LEX *lc, RES_ITEM *item, int index, int pass)
       } else if (strcmp(lc->str, "yes") == 0) {
          ((RUNSCRIPT*) item->value)->set_target("%c");
       } else if (strcmp(lc->str, "no") == 0) {
-         /* store nothing, run on director */
+         ((RUNSCRIPT*) item->value)->set_target("");
       } else {
          RES *res = GetResWithName(R_CLIENT, lc->str);
          if (res == NULL) {
@@ -1640,11 +1640,13 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
       if (strcmp(item->name, "runbeforejob") == 0) {
          script->when = SCRIPT_Before;
          script->abort_on_error = true;
+         script->set_target("");
 
       } else if (strcmp(item->name, "runafterjob") == 0) {
          script->when = SCRIPT_After;
          script->on_success = true;
          script->on_failure = false;
+         script->set_target("");
          
       } else if (strcmp(item->name, "clientrunafterjob") == 0) {
          script->old_proto = true;
@@ -1663,6 +1665,7 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
          script->when = SCRIPT_After;
          script->on_failure = true;
          script->on_success = false;
+         script->set_target("");
       }
 
       if (*runscripts == NULL) {