Skip to content

Commit

Permalink
all: imp openwrt
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Dec 27, 2021
1 parent 59f058f commit 6f50713
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/home/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func handleServiceInstallCommand(s service.Service) {

if aghos.IsOpenWrt() {
// On OpenWrt it is important to run enable after the service
// installation Otherwise, the service won't start on the system
// installation. Otherwise, the service won't start on the system
// startup.
_, err = runInitdCommand("enable")
if err != nil {
Expand Down Expand Up @@ -277,7 +277,9 @@ func handleServiceUninstallCommand(s service.Service) {
if err != nil {
log.Fatalf("service: running init disable: %s", err)
}
} else if err := svcAction(s, "stop"); err != nil {
}

if err := svcAction(s, "stop"); err != nil {
log.Debug("service: executing action %q: %s", "stop", err)
}

Expand Down Expand Up @@ -343,7 +345,9 @@ func configureService(c *service.Config) {
// returns command code or error if any
func runInitdCommand(action string) (int, error) {
confPath := "/etc/init.d/" + serviceName
// Pass the script and action as a single string argument.
code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action)

return code, err
}

Expand Down

0 comments on commit 6f50713

Please sign in to comment.