diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dec7286..3d0e5eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix default nodes.conf to use the new kernel command line list format. #1670 - Fix `make install` when `sudo` does not set `$PWD`. #1660 +- Use sh to parse and exec IPMI command. #1663 ## v4.6.0rc1, 2025-01-29 diff --git a/internal/pkg/power/ipmitool.go b/internal/pkg/power/ipmitool.go index 8e54eab0..1cc25f6c 100644 --- a/internal/pkg/power/ipmitool.go +++ b/internal/pkg/power/ipmitool.go @@ -67,7 +67,7 @@ func (ipmi *IPMI) Command() ([]byte, error) { if ipmi.ShowOnly { return []byte(cmdStr), nil } - ipmiCmd := exec.Command(cmdStr) + ipmiCmd := exec.Command("/bin/sh", "-c", cmdStr) return ipmiCmd.CombinedOutput() } @@ -76,7 +76,7 @@ func (ipmi *IPMI) InteractiveCommand() (err error) { if err != nil { return err } - ipmiCmd := exec.Command(cmdStr) + ipmiCmd := exec.Command("/bin/sh", "-c", cmdStr) ipmiCmd.Stdout = os.Stdout ipmiCmd.Stdin = os.Stdin ipmiCmd.Stderr = os.Stderr