add_prompt(ua, _("JobId")); /* 11 */
}
if (jcr->getJobType() == JT_BACKUP || jcr->getJobType() == JT_RESTORE || jcr->is_JobType(JT_VERIFY)) {
- add_prompt(ua, _("Plugin Options")); /* 12 */
+ add_prompt(ua, _("Plugin Options")); /* R:12 V:9 B:9*/
}
switch (do_prompt(ua, "", _("Select parameter to modify"), NULL, 0)) {
case 0:
jcr->where = bstrdup(ua->cmd);
goto try_again;
case 9:
- /* File relocation */
- select_where_regexp(ua, jcr);
- goto try_again;
- case 10:
- /* Replace */
- start_prompt(ua, _("Replace:\n"));
- for (i=0; ReplaceOptions[i].name; i++) {
- add_prompt(ua, ReplaceOptions[i].name);
+ if (jcr->getJobType() == JT_RESTORE) {
+ /* File relocation */
+ select_where_regexp(ua, jcr);
+ goto try_again;
}
- opt = do_prompt(ua, "", _("Select replace option"), NULL, 0);
- if (opt >= 0) {
- rc.replace = ReplaceOptions[opt].name;
- jcr->replace = ReplaceOptions[opt].token;
+ case 10:
+ if (jcr->getJobType() == JT_RESTORE) {
+ /* Replace */
+ start_prompt(ua, _("Replace:\n"));
+ for (i=0; ReplaceOptions[i].name; i++) {
+ add_prompt(ua, ReplaceOptions[i].name);
+ }
+ opt = do_prompt(ua, "", _("Select replace option"), NULL, 0);
+ if (opt >= 0) {
+ rc.replace = ReplaceOptions[opt].name;
+ jcr->replace = ReplaceOptions[opt].token;
+ }
+ } else {
+ /* Plugin Options for verify data */
+ if (!get_cmd(ua, _("Please enter the Plugin Options string: "))) {
+ break;
+ }
+ if (jcr->plugin_options) {
+ free(jcr->plugin_options);
+ jcr->plugin_options = NULL;
+ }
+ jcr->plugin_options = bstrdup(ua->cmd);
}
goto try_again;
case 11:
}
goto try_again;
case 12:
-
if (jcr->getJobType() == JT_RESTORE) {
plugin_config(ua, jcr, rc);
-
- } else {
- //generate_plugin_event(jcr, bEventJobConfig, &rc);
-
- /* Plugin Options */
- if (!get_cmd(ua, _("Please Plugin Options string: "))) {
- break;
- }
- if (jcr->plugin_options) {
- free(jcr->plugin_options);
- jcr->plugin_options = NULL;
- }
- jcr->plugin_options = bstrdup(ua->cmd);
}
goto try_again;
case -1: /* error or cancel */
ua->send_msg(_("Plugin Options specified twice.\n"));
return false;
}
- rc.plugin_options = ua->argv[i];
+ rc.plugin_options = bstrdup(ua->argv[i]);
if (!acl_access_ok(ua, PluginOptions_ACL, rc.plugin_options)) {
ua->send_msg(_("No authorization for \"PluginOptions\" specification.\n"));
return false;
rc.verify_job = rc.job->verify_job;
}
- if (rc.job->JobType == JT_VERIFY && rc.job->PluginOptions) {
- rc.plugin_options = rc.job->PluginOptions;
+ if (rc.job->JobType == JT_VERIFY && !rc.plugin_options && rc.job->PluginOptions) {
+ rc.plugin_options = bstrdup(rc.job->PluginOptions);
}
if (rc.previous_job_name) {