Issue #799 Fixed systemctl commands

This commit is contained in:
Bruno Lottero 2022-10-31 16:21:53 -03:00
parent fabe2ffa2f
commit c4853f8f4f
1 changed files with 12 additions and 0 deletions

View File

@ -293,6 +293,10 @@ func installSystemd(templateArgs *ServiceTemplateArgs, log *zerolog.Logger) erro
log.Err(err).Msg("systemctl enable cloudflared-restart.path error")
return err
}
if err := runCommand("systemctl", "start", "cloudflared-restart.path"); err != nil {
log.Err(err).Msg("systemctl start cloudflared-restart.path error")
return err
}
if err := runCommand("systemctl", "start", "cloudflared-update.timer"); err != nil {
log.Err(err).Msg("systemctl start cloudflared-update.timer error")
return err
@ -355,6 +359,14 @@ func uninstallSystemd(log *zerolog.Logger) error {
log.Err(err).Msgf("systemctl stop %s error", cloudflaredService)
return err
}
if err := runCommand("systemctl", "disable", "cloudflared-restart.path"); err != nil {
log.Err(err).Msg("systemctl disable cloudflared-restart.path error")
return err
}
if err := runCommand("systemctl", "stop", "cloudflared-restart.path"); err != nil {
log.Err(err).Msg("systemctl stop cloudflared-restart.path error")
return err
}
if err := runCommand("systemctl", "stop", "cloudflared-update.timer"); err != nil {
log.Err(err).Msg("systemctl stop cloudflared-update.timer error")
return err