// Undo implements plan.Resource
Undo implements plan.Resource
// Undo implements plan . Resource
func (p *Service) Undo(r plan.Runner, current plan.State) error {
	if current.Bool("enabled") == true {
		output, err := systemd(r, "disable %s", p.Name)
		if err != nil {
			if strings.Contains(output, "not loaded") {
				return nil
			}
			return fmt.Errorf("%s: %s", output, err.Error())
		}
	}
	if current.String("status") != "inactive" {
		output, err := systemd(r, "stop %s", p.Name)
		if err != nil {
			if strings.Contains(output, "not loaded") {
				return nil
			}
			return fmt.Errorf("%s: %s", output, err.Error())
		}
	}
	return nil
}
func ( p * Service ) Undo ( r plan . Runner , current plan . State ) error { if current . Bool ( " " ) == true { output , err := systemd ( r , " " , p . Name ) if err != nil { if strings . Contains ( output , " " ) { return nil } return fmt . Errorf ( " " , output , err . Error ( ) ) } } if current . String ( " " ) != " " { output , err := systemd ( r , " " , p . Name ) if err != nil { if strings . Contains ( output , " " ) { return nil } return fmt . Errorf ( " " , output , err . Error ( ) ) } } return nil }
Undo implements plan.Resource
Undo implements plan . Resource