Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 22, 2024
1 parent 2f2e98d commit 9461be4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ pub trait Service {
pub fn enable_services(ctx: &mut Context, services: Vec<ServiceDetail>) -> Result<()> {
let mut kaspad_networks = Vec::new();

let mut resolver_enabled = false;
for service in services {
match service.kind {
ServiceKind::Kaspad(network) => kaspad_networks.push(network),
ServiceKind::Resolver => {
resolver_enabled = true;
ctx.config.resolver.enabled = true;
ctx.config.save()?;

Expand All @@ -92,6 +94,15 @@ pub fn enable_services(ctx: &mut Context, services: Vec<ServiceDetail>) -> Resul
}
}

if !resolver_enabled {
ctx.config.resolver.enabled = false;
ctx.config.save()?;
if systemd::is_enabled(&ctx.config.resolver)? {
systemd::stop(&ctx.config.resolver)?;
systemd::disable(&ctx.config.resolver)?;
}
}

kaspad::configure_networks(ctx, kaspad_networks)?;
nginx::reconfigure(ctx)?;

Expand Down

0 comments on commit 9461be4

Please sign in to comment.