Blob Blame History Raw
--- wvdial-1.54.0/wvdial.1.remotename	2003-11-14 20:46:13.000000000 +0100
+++ wvdial-1.54.0/wvdial.1	2004-06-21 15:25:24.147270464 +0200
@@ -59,9 +59,15 @@
 normal method of having wvdial negotiate the connection and then call
 pppd.
 .TP
+.I "\-\-remotename"
+Override the Remote Name setting in the dialer configuration section of the
+configuration file. This is mainly useful when you dial to multiple systems
+with the same user name and password, and you don't want to use inheritance
+to override this setting (which is the recommended way to do it).
+.TP
 .I "\-\-config \fR[\|\fIconfigfile\fR\|]
 Run wvdial with configfile as the configuration file (instead of
-/etc/wvdial.conf). This is mainly usefull only if you want to have per-user
+/etc/wvdial.conf). This is mainly useful only if you want to have per-user
 configurations, or you want to avoid having dial-up information (usernames,
 passwords, calling card numbers, etc.) in a system wide configuration file.
 .TP
--- wvdial-1.54.0/wvdial.cc.remotename	2003-11-14 20:46:13.000000000 +0100
+++ wvdial-1.54.0/wvdial.cc	2004-06-21 15:25:24.129273200 +0200
@@ -95,6 +95,7 @@
     
     bool chat_mode = false;
     bool write_syslog = true;
+    WvString *remote_name = NULL;
     
     signal( SIGTERM, signalhandler );
     signal( SIGINT, signalhandler );
@@ -119,6 +120,12 @@
 		    return 1;			    
 		}
 	    }
+	    if( !strcmp( argv[i], "--remotename" ) ) 
+	    {
+		++i;
+		remote_name = new WvString(argv[i]);
+		continue;
+	    }
             if( strchr( argv[i], '=' ) ) {
                 havecmdlineopts = 1;
                 cmdlineopts.append(new WvString(argv[i]),true);
@@ -209,7 +216,7 @@
 			       WvLog::Debug2 );
     }
     
-    WvDialer dialer( cfg, &sections, chat_mode );
+    WvDialer dialer( cfg, &sections, chat_mode, remote_name );
     
     if( !chat_mode )
 	if( dialer.isok() && dialer.options.ask_password )
--- wvdial-1.54.0/wvdialer.h.remotename	2003-11-14 20:46:13.000000000 +0100
+++ wvdial-1.54.0/wvdialer.h	2004-06-21 15:26:25.040013360 +0200
@@ -43,7 +43,8 @@
 /***********************************/
 {
 public:
-    WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode = false );
+    WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode = false,
+	      WvString *_remote_name = NULL );
     virtual ~WvDialer();
    
     bool	dial();
--- wvdial-1.54.0/wvdialtext.cc.remotename	2003-11-14 20:46:13.000000000 +0100
+++ wvdial-1.54.0/wvdialtext.cc	2004-06-21 15:25:24.145270768 +0200
@@ -19,6 +19,7 @@
 "  options:  --config configfile    use configfile instead of /etc/wvdial.conf\n"
 " 				    or $HOME/.wvdial.conf\n"
 "	     --chat		    used when running wvdial from pppd\n"
+"	     --remotename	    remotename to pass to pppd\n"
 "  	     --help		    display this help and exit\n"
 " 	     --version		    output version information and exit\n"
 "	     --no-syslog	    don't send output to SYSLOG\n"
--- wvdial-1.54.0/wvdialer.cc.remotename	2003-11-14 20:46:13.000000000 +0100
+++ wvdial-1.54.0/wvdialer.cc	2004-06-21 15:27:06.341734544 +0200
@@ -53,7 +53,8 @@
 //       WvDialer Public Functions
 //**************************************************
 
-WvDialer::WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode )
+WvDialer::WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode,
+                    WvString *_remote_name )
 /***************************************************************************/
 : WvStreamClone( 0 ),
     cfg(_cfg), log( "WvDial", WvLog::Debug ),
@@ -123,6 +124,12 @@
 	return;
     }
 
+    // Override configuration settings with any we got from the command-line.
+    if( _remote_name != NULL ) {
+        options.remote = *_remote_name;
+        options.remote.unique();
+    }
+
     if (options.provider.len()) 
     {
 	log( WvLog::Notice, "Dialing %s %s.\n",
@@ -1209,6 +1216,8 @@
 	options.new_pppd && options.idle_seconds >= 0 ? (const char *)idle_seconds : NULL, 
 	"logfd", buffer1,
 //	!!buffer2 ? "passwordfd" : NULL, !!buffer2 ? (const char *)buffer2 : NULL,
+	options.remote.len() ? "remotename"   : NULL,
+	options.remote.len() ? (const char *) options.remote : NULL,
 	NULL
     };