go-edit-fstab

command module
v0.0.0-...-9ae0d20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 7 Imported by: 0

README

go-edit-fstab

What is it?

It is really cumbersome to edit the fstab via ansible with a template engine.

So this small go binary let's you allow to add, remove or edit existing paramters via cmdline flags :)

How to use

# This will create a new file in tmp
# if you wish to edit it directly remove both environment values
export fstab="/etc/fstab"
export targetFstab="/etc/newFstab"

# remove mountpoint := removes mountpoint
# edit key=value := adds or edit parameter
# key can be := {device, mountPoint, fsType, options, dump, pass}
# value = any valid string, for dump and pass value will be "booleanified"
go-edit-fstab <operation1> <mountpoint> "<key>=value" <operation2> ..

# change root and boot to ro mount
go run main.go edit "/boot" options=defaults,ro edit "/" options="defaults,noatime,ro" edit "/" pass="0"

State

I've just coded it in 3h and just tested it. Use with caution :)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL