This repository was archived by the owner on Nov 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -263,17 +263,19 @@ app.on('ready', () => {
263263 contextMenu . items [ 1 ] . checked = ! arg
264264 } )
265265
266- ; ( async function ( ) {
267- const { cfg} = await VRouter . getLatestCfg ( )
268- setInterval ( async ( ) => {
269- const currentGWIP = await Utils . getCurrentGateway ( )
270- const currentDnsIP = await Utils . getCurrentDns ( )
271- if ( currentGWIP !== currentDnsIP && [ currentGWIP , currentDnsIP ] . includes ( cfg . openwrt . ip ) ) {
272- logger . info ( `currentGWIP/currentDnsIP not match, correct them to ${ cfg . openwrt . ip } ` )
273- await VRouter . toggleRouting ( true , 'on' ) . catch ( console . warn )
274- } else {
275- // change menubar icon
276- }
277- } , 120000 )
278- } ) ( )
266+ if ( os . platform ( ) === 'darwin' ) {
267+ ; ( async function ( ) {
268+ const { cfg} = await VRouter . getLatestCfg ( )
269+ setInterval ( async ( ) => {
270+ const currentGWIP = await Utils . getCurrentGateway ( )
271+ const currentDnsIP = await Utils . getCurrentDns ( )
272+ if ( currentGWIP !== currentDnsIP && [ currentGWIP , currentDnsIP ] . includes ( cfg . openwrt . ip ) ) {
273+ logger . info ( `currentGWIP/currentDnsIP not match, correct them to ${ cfg . openwrt . ip } ` )
274+ await VRouter . toggleRouting ( true , 'on' ) . catch ( console . warn )
275+ } else {
276+ // change menubar icon
277+ }
278+ } , 120000 )
279+ } ) ( )
280+ }
279281} )
You can’t perform that action at this time.
0 commit comments