mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-07 17:10:07 +08:00
parent
f5f379465f
commit
e782f75863
@ -198,6 +198,10 @@ func (u *DockerService) UpdateConf(req dto.SettingUpdate) error {
|
|||||||
}
|
}
|
||||||
if len(daemonMap) == 0 {
|
if len(daemonMap) == 0 {
|
||||||
_ = os.Remove(constant.DaemonJsonPath)
|
_ = os.Remove(constant.DaemonJsonPath)
|
||||||
|
stdout, err := cmd.Exec("systemctl restart docker")
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(string(stdout))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
newJson, err := json.MarshalIndent(daemonMap, "", "\t")
|
newJson, err := json.MarshalIndent(daemonMap, "", "\t")
|
||||||
@ -304,6 +308,10 @@ func (u *DockerService) UpdateIpv6Option(req dto.Ipv6Option) error {
|
|||||||
func (u *DockerService) UpdateConfByFile(req dto.DaemonJsonUpdateByFile) error {
|
func (u *DockerService) UpdateConfByFile(req dto.DaemonJsonUpdateByFile) error {
|
||||||
if len(req.File) == 0 {
|
if len(req.File) == 0 {
|
||||||
_ = os.Remove(constant.DaemonJsonPath)
|
_ = os.Remove(constant.DaemonJsonPath)
|
||||||
|
stdout, err := cmd.Exec("systemctl restart docker")
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(string(stdout))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
err := createIfNotExistDaemonJsonFile()
|
err := createIfNotExistDaemonJsonFile()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user