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

Commit affd47e

Browse files
author
icymind
committed
fix bug: didn't restart service after change profile
1 parent 02a51a5 commit affd47e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/renderer/lib/openwrt.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ forward-zone:
360360
const serviceName = proxiesInfo[proxy].serviceName.shadowsocks
361361
const servicePath = `/etc/init.d/${serviceName}`
362362
const serviceStop = `${servicePath} disable; ${servicePath} stop;`
363-
const serviceStart = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} start;`
363+
const serviceStart = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} restart;`
364364

365365
const serviceNameR = proxiesInfo[proxy].serviceName.shadowsocksr
366366
const servicePathR = `/etc/init.d/${serviceNameR}`
367367
const serviceStopR = `${servicePathR} disable; ${servicePathR} stop;`
368-
const serviceStartR = `chmod +x ${servicePathR} && ${servicePathR} enable; ${servicePathR} start;`
368+
const serviceStartR = `chmod +x ${servicePathR} && ${servicePathR} enable; ${servicePathR} restart;`
369369

370370
if (tunnelDnsAction === 'off') {
371371
let cmd = `${serviceStop}${serviceStopR}`
@@ -386,7 +386,7 @@ forward-zone:
386386
logger.info(`${servicePath} ${action}`)
387387

388388
// ${servicePath} enable 执行的结果是1, 而不是常规的0
389-
const startCmd = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} start`
389+
const startCmd = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} restart`
390390
const stopCmd = `${servicePath} disable; ${servicePath} stop`
391391
if (action === 'off') {
392392
return this.execute(stopCmd)

0 commit comments

Comments
 (0)