]> git.sur5r.net Git - bacula/bacula/commitdiff
Tweak restore command
authorKern Sibbald <kern@sibbald.com>
Mon, 31 Mar 2003 19:45:22 +0000 (19:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 31 Mar 2003 19:45:22 +0000 (19:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@407 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_restore.c
bacula/src/dird/ua_select.c

index f41db51da68c6dfab7b7a4da758459abe3dafb17..fa03450b1f52aaf13288d7096ed546599ad844a7 100644 (file)
@@ -253,17 +253,21 @@ int restorecmd(UAContext *ua, char *cmd)
       return 0;
    }
 
-   if (ji.ClientName[0]) {
-      Mmsg(&ua->cmd, 
-         "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"",
-         job->hdr.name, ji.ClientName, ji.store?ji.store->hdr.name:"",
-        working_directory);
-   } else {
-      Mmsg(&ua->cmd, 
-         "run job=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"",
-         job->hdr.name, ji.store?ji.store->hdr.name:"", working_directory);
+   /* If no client name specified yet, get it now */
+   if (!ji.ClientName[0]) {
+      CLIENT_DBR cr;
+      memset(&cr, 0, sizeof(cr));
+      if (!get_client_dbr(ua, &cr)) {
+        return 0;
+      }
+      bstrncpy(ji.ClientName, cr.Name, sizeof(ji.ClientName));
    }
-   
+
+    /* Build run command */
+    Mmsg(&ua->cmd, 
+       "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"",
+       job->hdr.name, ji.ClientName, ji.store?ji.store->hdr.name:"",
+       working_directory);
 
    Dmsg1(400, "Submitting: %s\n", ua->cmd);
    
index 477572ff34697762507884455b8b9204c432b464..f365f2aa03c9c25cb6cb2d9606376e49a89a43a8 100644 (file)
@@ -619,6 +619,7 @@ int do_prompt(UAContext *ua, char *msg, char *prompt, int max_prompt)
    for ( ;; ) {
       /* First item is the prompt string, not the items */
       if (ua->num_prompts == 1) { 
+         bsendmsg(ua, _("Selection is empty!\n"));
         item = 0;                    /* list is empty ! */
         break;
       }