Esempio n. 1
0
        public static void Enable()
        {
            var s = new TorConfigurationModel {
                IsActive = true, Services = ServiceModel.Services
            };
            var text = JsonConvert.SerializeObject(s, Formatting.Indented);

            FileWithAcl.WriteAllText(CfgFile, text, "644", "root", "wheel");
            ConsoleLogger.Log("[tor] enabled");
        }
Esempio n. 2
0
        public static void Save(List <TorService> model)
        {
            var s = new TorConfigurationModel {
                IsActive = ServiceModel.IsActive, Services = model
            };
            var text = JsonConvert.SerializeObject(s, Formatting.Indented);

            FileWithAcl.WriteAllText(CfgFile, text, "644", "root", "wheel");
            ConsoleLogger.Log("[tor] configuration saved");
        }