int confirm_retention(UAContext *ua, utime_t *ret, const char *msg)
{
char ed1[100];
+ int val;
for ( ;; ) {
bsendmsg(ua, _("The current %s retention period is: %s\n"),
}
continue;
}
- if (strcasecmp(ua->cmd, _("yes")) == 0) {
- return 1;
- }
- if (strcasecmp(ua->cmd, _("no")) == 0) {
- return 0;
+ if (is_yesno(ua->cmd, &val)) {
+ return val; /* is 1 for yes, 0 for no */
}
}
return 1;
bsendmsg(ua, _("JobId %s is not running.\n"), edit_int64(jobid, ed1));
return NULL;
}
- store = jcr->store;
+ store = jcr->wstore;
free_jcr(jcr);
break;
bsendmsg(ua, _("Job \"%s\" is not running.\n"), ua->argv[i]);
return NULL;
}
- store = jcr->store;
+ store = jcr->wstore;
free_jcr(jcr);
break;
} else if (strcasecmp(ua->argk[i], NT_("ujobid")) == 0) {
bsendmsg(ua, _("Job \"%s\" is not running.\n"), ua->argv[i]);
return NULL;
}
- store = jcr->store;
+ store = jcr->wstore;
free_jcr(jcr);
break;
}
return drive;
}
+/* Get slot that we are working with for this storage */
+int get_storage_slot(UAContext *ua, STORE *store)
+{
+ int i, slot = -1;
+ /* Get slot for autochanger if possible */
+ i = find_arg_with_value(ua, "slot");
+ if (i >=0) {
+ slot = atoi(ua->argv[i]);
+ } else if (store && store->autochanger) {
+ /* Ask user to enter slot number */
+ ua->cmd[0] = 0;
+ if (!get_cmd(ua, _("Enter autochanger slot: "))) {
+ slot = -1; /* None */
+ } else {
+ slot = atoi(ua->cmd);
+ }
+ }
+ return slot;
+}
+
+
/*
* Scan looking for mediatype=