Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit 2b3b994

Browse files
author
icymind
committed
sudoExec windows command
1 parent 2ec8034 commit 2b3b994

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/renderer/lib/win.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ async function changeDns (index, ip) { // eslint-disable-line
9090
const infIndex = index || await getActiveAdapterIndex()
9191
const cmd = `WMIC nicconfig where "InterfaceIndex = ${infIndex}" call SetDNSServerSearchOrder ("${ip}")`
9292
logger.info(`about to changeDns to ${ip}`)
93-
return execute(cmd)
93+
return sudoExec(cmd)
9494
}
9595

9696
async function changeGateway (index, ip) { // eslint-disable-line
9797
const infIndex = index || await getActiveAdapterIndex()
9898
const cmd = `WMIC nicconfig where "InterfaceIndex = ${infIndex}" call SetGateways ("${ip}")`
9999
logger.info(`about to changeGateway to ${ip}`)
100-
return execute(cmd)
100+
return sudoExec(cmd)
101101
}
102102

103103
async function getRouterIP () { // eslint-disable-line
@@ -126,15 +126,15 @@ async function infNameToIndex (infName) {
126126

127127
async function enableDHCP (index) {
128128
const cmd = `WMIC nicconfig where "InterfaceIndex = ${index}" call EnableDHCP`
129-
return execute(cmd)
129+
return sudoExec(cmd)
130130
}
131131
async function enableStatic (index, ip, mask) {
132132
const cmd = `WMIC nicconfig where "InterfaceIndex = ${index}" call EnableStatic ("${ip}"),("${mask}")`
133-
return execute(cmd)
133+
return sudoExec(cmd)
134134
}
135135
async function emptyDNS (index) {
136136
const cmd = `WMIC nicconfig where "InterfaceIndex = ${index}" call SetDNSServerSearchOrder`
137-
return execute(cmd)
137+
return sudoExec(cmd)
138138
}
139139

140140
class Win {

0 commit comments

Comments
 (0)