Some code reorg

This commit is contained in:
yo
2022-04-24 16:55:33 +02:00
parent 43f26d099f
commit e4fc9c3a6c
4 changed files with 50 additions and 43 deletions

View File

@ -214,6 +214,29 @@ func executeCommandInJail(jail *Jail, cmdline string) (string, error) {
return string(out), err
}
/*****************************************************************************
*
* rc.conf management
*
*****************************************************************************/
func enableRcKeyValue(rcconfpath string, key string, value string) error {
cmd := fmt.Sprintf("/usr/sbin/sysrc -f %s %s=%s", rcconfpath, key, value)
_, err := executeCommand(cmd)
if err != nil {
return err
}
return nil
}
func disableRcKey(rcconfpath string, key string) error {
cmd := fmt.Sprintf("/usr/sbin/sysrc -f %s -x %s", rcconfpath, key)
_, err := executeCommand(cmd)
if err != nil {
return err
}
return nil
}
/*****************************************************************************
* Parse an fstab file, returning an array of Mount
*****************************************************************************/