diff --git a/cmd/update.go b/cmd/update.go index dfd66f1..02a16f7 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -21,7 +21,7 @@ func updateJail(jail *Jail) error { defer cfgFile.Close() defer os.Remove(cfgFile.Name()) - // Folder containing update/uipgrade temporary files. Common so we save bandwith when upgrading multiple jails + // Folder containing update/upgrade temporary files. Common so we save bandwith when upgrading multiple jails // TODO: Variabilize /iocage/freebsd-update _, err = os.Stat("/iocage/freebsd-update") if os.IsNotExist(err) { @@ -30,11 +30,15 @@ func updateJail(jail *Jail) error { } } - cmd := fmt.Sprintf("/usr/sbin/freebsd-update --not-running-from-cron -f %s -b %s --currently-running %s fetch install", + cmd := fmt.Sprintf("/usr/sbin/freebsd-update --not-running-from-cron -f %s -b %s --currently-running %s fetch", cfgFile.Name(), jail.RootPath, jail.Config.Release) + err = executeCommandWithOutputToStdout(cmd) + if err != nil { + return err + } - //fmt.Printf("DEBUG: Prepare to execute \"%s\"\n", cmd) - + cmd = fmt.Sprintf("/usr/sbin/freebsd-update --not-running-from-cron -f %s -b %s --currently-running %s install", + cfgFile.Name(), jail.RootPath, jail.Config.Release) err = executeCommandWithOutputToStdout(cmd) if err != nil { return err