parent
054f48024d
commit
2bdf22c53d
2
main.go
2
main.go
|
@ -28,7 +28,7 @@ var ttyS0 string
|
||||||
|
|
||||||
func doCmd(str string) {
|
func doCmd(str string) {
|
||||||
var stderr bytes.Buffer
|
var stderr bytes.Buffer
|
||||||
log.Println("TestExec =", args.TestExec)
|
log.Println("doCmd()", str)
|
||||||
args := strings.Split(str, " ")
|
args := strings.Split(str, " ")
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
cmd := exec.Command(args[0], args[1:]...)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|
|
@ -69,14 +69,19 @@ func mainTab(n *gui.Node) {
|
||||||
})
|
})
|
||||||
|
|
||||||
rn.NewButton("ttyS0", func () {
|
rn.NewButton("ttyS0", func () {
|
||||||
|
myGui.CloseToolkit("gocui")
|
||||||
// systemctl enable serial-getty@ttyS0.service
|
// systemctl enable serial-getty@ttyS0.service
|
||||||
// cp ttyS0.conf /etc/init/
|
// cp ttyS0.conf /etc/init/
|
||||||
foo := []byte(ttyS0)
|
foo := []byte(ttyS0)
|
||||||
ioutil.WriteFile("/etc/init.d/ttyS0", foo, 0644)
|
ioutil.WriteFile("/etc/init.d/ttyS0", foo, 0644)
|
||||||
myGui.CloseToolkit("gocui")
|
|
||||||
doCmd("ls -l")
|
doCmd("ls -l")
|
||||||
doCmd("cat /etc/init.d/ttyS0")
|
doCmd("cat /etc/init.d/ttyS0")
|
||||||
doCmd("systemctl enable serial-getty@ttyS0.service")
|
doCmd("systemctl enable serial-getty@ttyS0.service")
|
||||||
|
doCmd("service serial-getty@ttyS0 start")
|
||||||
|
os.Exit(0)
|
||||||
|
})
|
||||||
|
rn.NewButton("git config", func () {
|
||||||
|
doCmd("git config pull.rebase false")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue