Compare commits

..

No commits in common. "4edd0b74146d4761c172b42b6562b439510dfb6b" and "26ceb1630ac26473f86490933026be86e395b5a9" have entirely different histories.

4 changed files with 8 additions and 17 deletions

View File

@ -1,9 +1,8 @@
package cmd
import (
"os"
"fmt"
"errors"
"fmt"
"reflect"
"strconv"
"strings"
@ -21,7 +20,7 @@ func GetJailProperties(args []string) {
jail, err = getJailFromArray(a, []string{""}, gJails)
if err != nil {
fmt.Printf("Error: %s\n", err.Error())
os.Exit(1)
return
}
} else {
props = append(props, a)

View File

@ -14,7 +14,7 @@ import (
)
const (
gVersion = "0.39"
gVersion = "0.38b"
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000

View File

@ -840,7 +840,7 @@ func setupVnetInterfaceHostSide(jail *Jail) ([]string, error) {
bridge := v[1]
// Get host side MAC
pname := fmt.Sprintf("Config.%s_mac", strings.Title(nic))
pname := fmt.Sprintf("Config.%s_mac", nic)
var val *reflect.Value
val, pname, err = getStructFieldValue(jail, pname)
if err != nil {
@ -853,10 +853,7 @@ func setupVnetInterfaceHostSide(jail *Jail) ([]string, error) {
return []string{}, err
}
} else {
hsmac, err = hex.DecodeString(strings.Split(val.String(), " ")[0])
if err != nil {
return []string{}, fmt.Errorf("Error converting %s to hex\n", strings.Split(val.String(), " ")[0])
}
hsmac = val.Bytes()
}
// Get bridge MTU
@ -937,7 +934,7 @@ func setupVnetInterfaceJailSide(jail *Jail, hostepairs []string) error {
jsepair := fmt.Sprintf("%sb", strings.TrimSuffix(hostepairs[i], "a"))
// Get jail side MAC
pname := fmt.Sprintf("Config.%s_mac", strings.Title(nic))
pname := fmt.Sprintf("Config.%s_mac", nic)
var val *reflect.Value
val, pname, err = getStructFieldValue(jail, pname)
if err != nil {
@ -950,11 +947,7 @@ func setupVnetInterfaceJailSide(jail *Jail, hostepairs []string) error {
return err
}
} else {
jsmac, err = hex.DecodeString(strings.Split(val.String(), " ")[1])
if err != nil {
return fmt.Errorf("Error converting %s to hex\n", strings.Split(val.String(), " ")[1])
}
jsmac = val.Bytes()
}
cmd := fmt.Sprintf("/sbin/ifconfig %s vnet %s", jsepair, jail.InternalName)

View File

@ -917,8 +917,7 @@ func getFstab(path string) ([]Mount, error) {
scan := bufio.NewScanner(f)
for scan.Scan() {
res := strings.Fields(scan.Text())
// iocage create lines like that : "/iocage/releases/13.2-RELEASE/root/bin /iocage/jails/smtp-router-02/root/bin nullfs ro 0 0 # Added by iocage on 2023-10-10 17:20:51"
if (len(res) > 6 && !strings.EqualFold(res[6], "#")) || len(res) < 6 {
if len(res) != 6 {
return mounts, fmt.Errorf("Incorrect format for fstab line %s", scan.Text())
}
freq, err := strconv.Atoi(res[4])