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

Commit

Permalink
fix bug: didn't restart service after change profile
Browse files Browse the repository at this point in the history
  • Loading branch information
icymind committed Nov 1, 2017
1 parent 02a51a5 commit affd47e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/lib/openwrt.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ forward-zone:
const serviceName = proxiesInfo[proxy].serviceName.shadowsocks
const servicePath = `/etc/init.d/${serviceName}`
const serviceStop = `${servicePath} disable; ${servicePath} stop;`
const serviceStart = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} start;`
const serviceStart = `chmod +x ${servicePath} && ${servicePath} enable; ${servicePath} restart;`

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

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

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

0 comments on commit affd47e

Please sign in to comment.