all: add support to Netgear Orbi Voxel

While at it, also ensure checking the service is installed or not before
executing uninstall function, so we won't emit un-necessary errors.
This commit is contained in:
Cuong Manh Le
2024-03-19 18:11:33 +07:00
committed by Cuong Manh Le
parent b50cccac85
commit 20f8f22bae
6 changed files with 261 additions and 3 deletions

View File

@@ -1783,6 +1783,10 @@ func readConfigWithNotice(writeDefaultConfig, notice bool) {
}
func uninstall(p *prog, s service.Service) {
if _, err := s.Status(); err != nil && errors.Is(err, service.ErrNotInstalled) {
mainLog.Load().Error().Msg(err.Error())
return
}
tasks := []task{
{s.Stop, false},
{s.Uninstall, true},
@@ -2233,7 +2237,6 @@ func newSocketControlClient(s service.Service, dir string) *controlClient {
for {
curStatus, err := s.Status()
if err != nil {
mainLog.Load().Warn().Err(err).Msg("could not get service status while doing self-check")
return nil
}
if curStatus != service.StatusRunning {

View File

@@ -20,7 +20,7 @@ func newService(i service.Interface, c *service.Config) (service.Service, error)
return nil, err
}
switch {
case router.IsOldOpenwrt():
case router.IsOldOpenwrt(), router.IsNetGearOrbi():
return &procd{&sysV{s}}, nil
case router.IsGLiNet():
return &sysV{s}, nil