We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f7c72f commit 6a196d1Copy full SHA for 6a196d1
src/ip-manager.ts
@@ -134,9 +134,10 @@ export default class IPManager {
134
* A base subnet string.
135
*/
136
private getAvailableSubnet(): string {
137
+ const ifconfig_command = this.config.platform === 'darwin' ? 'ifconfig' : 'ip a'
138
for (let i = 18; i <= 31; i++) {
139
const subnet = '172.' + i + '.0'
- const existing = execSync('sudo ifconfig | grep ' + subnet + ' | wc -l').toString().trim()
140
+ const existing = execSync('sudo ' + ifconfig_command + ' | grep ' + subnet + ' | wc -l').toString().trim()
141
if (existing === '0') {
142
return subnet
143
}
0 commit comments