We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba836ee commit 535c18cCopy full SHA for 535c18c
1 file changed
ifconfig.js
@@ -236,14 +236,16 @@ function down(interface, callback) {
236
* };
237
*
238
* ifconfig.up(options, function(err) {
239
- * // the interface is up
+ * // the interface is up
240
* });
241
242
+ * ipv4_address, ipv4_broadcast and ipv4_subnet_mask are optional
243
*/
244
function up(options, callback) {
245
return this.exec('ifconfig ' + options.interface +
- ' ' + options.ipv4_address +
246
- ' netmask ' + options.ipv4_subnet_mask +
247
- ' broadcast ' + options.ipv4_broadcast +
+ ' ' +
+ (options.ipv4_address) ? options.ipv4_address : '0.0.0.0' +
248
+ (options.ipv4_subnet_mask) ? ' netmask ' + options.ipv4_subnet_mask : '' +
249
+ (options.ipv4_broadcast) ? ' broadcast ' + options.ipv4_broadcast : '' +
250
' up', callback);
251
}
0 commit comments