The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
"\nVersion: " VERSION " (" BDATE ") %s %s %s\n\n"
"Usage: bconsole [-s] [-c config_file] [-d debug_level]\n"
" -D <dir> select a Director\n"
+" -l list Directors defined\n"
" -c <file> set configuration file to file\n"
" -d <nn> set debug level to <nn>\n"
" -dt print timestamp in debug output\n"
if (is_bnet_stop(UA_sock)) {
break; /* error or term */
} else if (stat == BNET_SIGNAL) {
- if (UA_sock->msglen == BNET_PROMPT) {
+ if (UA_sock->msglen == BNET_SUB_PROMPT) {
at_prompt = true;
}
Dmsg1(100, "Got poll %s\n", bnet_sig_to_ascii(UA_sock));
rl_completion_entry_function = dummy_completion_function;
rl_attempted_completion_function = readline_completion;
rl_filename_completion_desired = 0;
+ stifle_history(100);
#endif
return ret;
if (numdir == 1) { /* No choose */
dir = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
-
- } else if (director) { /* Command line choice */
+ }
+
+ if (director) { /* Command line choice overwrite the no choose option */
LockRes();
foreach_res(dir, R_DIRECTOR) {
if (bstrcmp(dir->hdr.name, director)) {
}
}
UnlockRes();
+ if (!dir) { /* Can't find Director used as argument */
+ senditf(_("Can't find %s in Director list\n"), director);
+ return 0;
+ }
}
if (!dir) { /* prompt for director */
{
int ch;
char *director=NULL;
+ bool list_directors=false;
bool no_signals = false;
bool test_config = false;
JCR jcr;
working_directory = "/tmp";
args = get_pool_memory(PM_FNAME);
- while ((ch = getopt(argc, argv, "bc:d:nstu:D:?")) != -1) {
+ while ((ch = getopt(argc, argv, "D:lbc:d:nstu:?")) != -1) {
switch (ch) {
case 'D': /* Director */
if (director) {
director = bstrdup(optarg);
break;
+ case 'l':
+ list_directors = true;
+ test_config = true;
+ break;
+
case 'c': /* configuration file */
if (configfile != NULL) {
free(configfile);
con_init(stdin);
}
+ if (list_directors) {
+ LockRes();
+ foreach_res(dir, R_DIRECTOR) {
+ senditf("%s\n", dir->hdr.name);
+ }
+ UnlockRes();
+ }
+
if (test_config) {
terminate_console(0);
exit(0);
start_watchdog(); /* Start socket watchdog */
if(!select_director(director, &dir, &cons)) {
- return 0;
+ return 1;
}
senditf(_("Connecting to Director %s:%d\n"), dir->address,dir->DIRport);