script

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebianGeneric

type DebianGeneric struct {
	LinuxGeneric
}

func (*DebianGeneric) ActivateDaemons

func (script *DebianGeneric) ActivateDaemons()

func (*DebianGeneric) AddPPA

func (script *DebianGeneric) AddPPA(ppa ...string)

func (*DebianGeneric) AddRepo

func (script *DebianGeneric) AddRepo(r interface{})

Example: wget -O- https://repo.saltstack.com/apt/ubuntu/14.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -

nano /etc/apt/sources.list.d/saltstack.list deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/2015.8 trusty main

func (*DebianGeneric) DeactivateDaemons

func (script *DebianGeneric) DeactivateDaemons()

func (*DebianGeneric) InstallPkgDeps

func (script *DebianGeneric) InstallPkgDeps()

func (*DebianGeneric) InstallPkgs

func (script *DebianGeneric) InstallPkgs(pkgs ...string)

func (*DebianGeneric) InstallSaltMaster

func (script *DebianGeneric) InstallSaltMaster(versions ...string)

func (*DebianGeneric) InstallSaltMinion

func (script *DebianGeneric) InstallSaltMinion(versions ...string)

func (*DebianGeneric) ProcessDisable

func (script *DebianGeneric) ProcessDisable(ps string)

func (*DebianGeneric) ProcessEnable

func (script *DebianGeneric) ProcessEnable(ps string)

func (*DebianGeneric) UpdateRepos

func (script *DebianGeneric) UpdateRepos()

func (*DebianGeneric) UpgradePkgs

func (script *DebianGeneric) UpgradePkgs()

type LinuxGeneric

type LinuxGeneric struct {
	// contains filtered or unexported fields
}

Linux version must use Systemd as init process

func (*LinuxGeneric) ActivateDaemons

func (script *LinuxGeneric) ActivateDaemons()

func (*LinuxGeneric) AddLine

func (script *LinuxGeneric) AddLine(file string, line string)

func (*LinuxGeneric) AppDir

func (script *LinuxGeneric) AppDir() string

func (*LinuxGeneric) CheckPathExists

func (script *LinuxGeneric) CheckPathExists(path string)

func (*LinuxGeneric) ChgrpRecurse

func (script *LinuxGeneric) ChgrpRecurse(name string, g string)

func (*LinuxGeneric) Chmod

func (script *LinuxGeneric) Chmod(name string, mode os.FileMode)

func (*LinuxGeneric) ChownRecurse

func (script *LinuxGeneric) ChownRecurse(name string, u string)

func (*LinuxGeneric) CmdOut

func (script *LinuxGeneric) CmdOut(def string, cmd string, args ...interface{}) string

func (*LinuxGeneric) DeactivateDaemons

func (script *LinuxGeneric) DeactivateDaemons()

func (*LinuxGeneric) Init

func (script *LinuxGeneric) Init(workingDir string)

func (*LinuxGeneric) Mkdir

func (script *LinuxGeneric) Mkdir(path string)

func (*LinuxGeneric) ProcessExists

func (script *LinuxGeneric) ProcessExists(ps string) bool

func (*LinuxGeneric) ProcessRestart

func (script *LinuxGeneric) ProcessRestart(ps ...string)

func (*LinuxGeneric) ProcessStart

func (script *LinuxGeneric) ProcessStart(ps ...string)

func (*LinuxGeneric) Raw

func (script *LinuxGeneric) Raw() interface{}

func (*LinuxGeneric) ReadAsBase64

func (script *LinuxGeneric) ReadAsBase64(path string) string

func (*LinuxGeneric) Run

func (script *LinuxGeneric) Run(cmd string, args ...interface{}) error

func (*LinuxGeneric) SetEnv

func (script *LinuxGeneric) SetEnv(key, value string)
func (script *LinuxGeneric) Symlink(oldname, newname string)

func (*LinuxGeneric) UncommentLine

func (script *LinuxGeneric) UncommentLine(file string, regex string)

func (*LinuxGeneric) UserExists

func (script *LinuxGeneric) UserExists(u string) bool

func (*LinuxGeneric) WorkingDir

func (script *LinuxGeneric) WorkingDir() string

func (*LinuxGeneric) WriteBase64String

func (script *LinuxGeneric) WriteBase64String(filename string, data string)

func (*LinuxGeneric) WriteBytes

func (script *LinuxGeneric) WriteBytes(filename string, data []byte)

func (*LinuxGeneric) WriteString

func (script *LinuxGeneric) WriteString(filename string, data string)

type Script

type Script interface {
	Init(workingDir string)

	AppDir() string
	WorkingDir() string
	Raw() interface{}
	CmdOut(def string, cmd string, args ...interface{}) string
	Run(cmd string, args ...interface{}) error
	SetEnv(key, value string)

	Mkdir(path string)
	Chmod(name string, mode os.FileMode)
	Symlink(oldname, newname string)
	ChownRecurse(name string, u string)
	ChgrpRecurse(name string, g string)

	UserExists(u string) bool

	CheckPathExists(path string)
	ReadAsBase64(path string) string
	WriteBase64String(filename string, data string)
	WriteString(filename string, data string)
	WriteBytes(filename string, data []byte)

	AddLine(file string, line string)
	UncommentLine(file string, regex string)

	ProcessExists(ps string) bool
	ProcessEnable(ps string)
	ProcessStart(ps ...string)
	ProcessRestart(ps ...string)
	ProcessDisable(ps string)

	AddRepo(r interface{})
	UpdateRepos()
	UpgradePkgs()
	InstallPkgDeps()

	InstallPkgs(pkgs ...string)
	DeactivateDaemons()
	ActivateDaemons()

	InstallSaltMaster(versions ...string)
	InstallSaltMinion(versions ...string)
}

type UbuntuGeneric

type UbuntuGeneric struct {
	DebianGeneric
}

func (*UbuntuGeneric) InstallSaltMaster

func (script *UbuntuGeneric) InstallSaltMaster(versions ...string)

func (*UbuntuGeneric) InstallSaltMinion

func (script *UbuntuGeneric) InstallSaltMinion(versions ...string)

func (*UbuntuGeneric) ProcessDisable

func (script *UbuntuGeneric) ProcessDisable(ps string)

func (*UbuntuGeneric) ProcessEnable

func (script *UbuntuGeneric) ProcessEnable(ps string)

Jump to

Keyboard shortcuts

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