@@ -361,12 +361,10 @@ def do_force_start(self, log_lvl=logger.INFO):
361
361
self .lease_vpn_ip (vpn_acc , log_lvl = log_lvl )
362
362
363
363
def do_force_stop (self , log_lvl = logger .INFO ):
364
- self .storage .set_current ('' )
364
+ if self .is_installed (silent = True ):
365
+ self .storage .set_current ('' )
365
366
self .post_exec (log_lvl = log_lvl , _force_stop = True )
366
- if self .device .dns_resolver .is_connman ():
367
- self .device .ip_resolver .renew_all_ip (silent = True )
368
- else :
369
- self .device .dns_resolver .restart ()
367
+ self .device .dns_resolver .restart ()
370
368
371
369
def lease_vpn_service (self , is_enable : bool = True , is_restart : bool = True , is_lease_ip : bool = False ,
372
370
account : Optional [str ] = None ):
@@ -395,12 +393,10 @@ def shutdown_vpn_service(self, is_stop=True, is_disable=False, vpn_service: str
395
393
if is_disable :
396
394
self .device .unix_service .disable (vpn_service )
397
395
if is_stop :
398
- self .device .unix_service .stop (vpn_service )
399
- if self .is_installed (silent = True ):
400
- self .storage .set_current ('' )
401
- self ._cleanup_zombie_vpn (log_lvl = log_lvl )
402
- if self .device .dns_resolver .is_connman ():
403
- self .device .ip_resolver .renew_all_ip (silent = True )
396
+ if self .device .unix_service .status (vpn_service ).is_running ():
397
+ self .device .unix_service .stop (vpn_service )
398
+ else :
399
+ self .do_force_stop (log_lvl )
404
400
405
401
def backup_config (self ):
406
402
backup_dir = self .opts .backup_dir ()
0 commit comments