mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
try to fix macos dns
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run
This commit is contained in:
parent
cf09e62034
commit
d137b372ea
|
@ -192,14 +192,12 @@ async function getDefaultService(password?: string): Promise<string> {
|
||||||
let device = deviceOut.split('\n').find((s) => s.includes('interface:'))
|
let device = deviceOut.split('\n').find((s) => s.includes('interface:'))
|
||||||
device = device?.trim().split(' ').slice(1).join(' ')
|
device = device?.trim().split(' ').slice(1).join(' ')
|
||||||
if (!device) throw new Error('Get device failed')
|
if (!device) throw new Error('Get device failed')
|
||||||
const { stdout: hardwareOut } = await execPromise(`${sudo}networksetup -listallhardwareports`)
|
const { stdout: order } = await execPromise(`${sudo}networksetup -listnetworkserviceorder`)
|
||||||
const hardware = hardwareOut
|
const block = order.split('\n\n').find((s) => s.includes(`Device: ${device}`))
|
||||||
.split('Ethernet Address:')
|
if (!block) throw new Error('Get networkservice failed')
|
||||||
.find((s) => s.includes(`Device: ${device}`))
|
for (const line of block.split('\n')) {
|
||||||
if (!hardware) throw new Error('Get hardware failed')
|
if (line.match(/^\(\d+\).*/)) {
|
||||||
for (const line of hardware.split('\n')) {
|
return line.trim().split(' ').slice(1).join(' ')
|
||||||
if (line.startsWith('Hardware Port:')) {
|
|
||||||
return line.trim().split(' ').slice(2).join(' ')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Error('Get service failed')
|
throw new Error('Get service failed')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user