Esempio n. 1
0
 def reset_hook(self, vpn_nameserver_hook_conf: Path):
     logger.info(f'Reset VPN DNS config file...')
     if FileHelper.is_writable(vpn_nameserver_hook_conf):
         FileHelper.write_file(vpn_nameserver_hook_conf,
                               mode=0o644,
                               content='')
         FileHelper.create_symlink(vpn_nameserver_hook_conf,
                                   self._dnsmasq_vpn_hook_cfg,
                                   force=True)
     else:
         FileHelper.rm(self._dnsmasq_vpn_hook_cfg)
Esempio n. 2
0
 def empty(self):
     if FileHelper.is_writable(self._account_file):
         self._dump({}, '', '')