From: Kern Sibbald Date: Mon, 31 Mar 2003 19:45:22 +0000 (+0000) Subject: Tweak restore command X-Git-Tag: Release-1.30~60 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6c025a2cc5f3f485173b6e4ab06f32599b7fde61;p=bacula%2Fbacula Tweak restore command git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@407 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index f41db51da6..fa03450b1f 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -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); diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index 477572ff34..f365f2aa03 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -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; }