- amfree(tape_server_name);
- tape_server_name = getenv("AMANDA_TAPESERVER");
- if(!tape_server_name) tape_server_name = client_getconf_str(CLN_TAPE_SERVER);
+ tape_server_name = NULL;
+ if (getconf_seen(CNF_TAPE_SERVER) == -2) { /* command line argument */
+ tape_server_name = getconf_str(CNF_TAPE_SERVER);
+ }
+ if (!tape_server_name) {
+ tape_server_name = getenv("AMANDA_TAPE_SERVER");
+ if (!tape_server_name) {
+ tape_server_name = getenv("AMANDA_TAPESERVER");
+ if (tape_server_name) {
+ g_printf(_("Using tape server from environment AMANDA_TAPESERVER (%s)\n"), tape_server_name);
+ }
+ } else {
+ g_printf(_("Using tape server from environment AMANDA_TAPE_SERVER (%s)\n"), tape_server_name);
+ }
+ }
+ if (!tape_server_name) {
+ tape_server_name = getconf_str(CNF_TAPE_SERVER);
+ }
+ if (!tape_server_name) {
+ error(_("No tape server set"));
+ /*NOTREACHED*/
+ }