2023-04-23 14:41:23 -05:00
|
|
|
package main
|
2024-01-24 22:02:08 -06:00
|
|
|
|
2023-04-23 14:41:23 -05:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
2024-02-15 03:28:16 -06:00
|
|
|
|
|
|
|
"go.wit.com/gui"
|
2023-04-23 14:41:23 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func aptTab() {
|
2024-02-15 03:28:16 -06:00
|
|
|
aptTab := gui.RawWindow("apt")
|
2023-04-23 14:41:23 -05:00
|
|
|
box := aptTab.NewBox("aptBox", false)
|
|
|
|
|
2024-01-24 22:02:08 -06:00
|
|
|
box.NewButton("apt sources", func() {
|
2023-04-23 14:41:23 -05:00
|
|
|
if _, err := os.Stat("/etc/apt/sources.list.d/wit.list"); err == nil {
|
|
|
|
log.Println("apt sources are already configured")
|
|
|
|
} else {
|
|
|
|
myGui.CloseToolkit("gocui")
|
|
|
|
writeRes("resources/", "/etc/", "apt/sources.list")
|
|
|
|
writeRes("resources/", "/etc/", "apt/sources.list.d/wit.list")
|
|
|
|
writeRes("resources/", "/etc/", "apt/sources.list.d/debian.list")
|
2023-04-28 07:26:55 -05:00
|
|
|
doCmd("mkdir /etc/wit/")
|
2023-04-23 14:41:23 -05:00
|
|
|
writeRes("resources/apt/", "/etc/wit/", "wit.gpg")
|
|
|
|
doCmd("apt update")
|
|
|
|
doCmd("apt dist-upgrade")
|
|
|
|
log.Println("\nYou should reboot now\n")
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2024-01-24 22:02:08 -06:00
|
|
|
box.NewButton("apt-file", func() {
|
2023-04-23 14:41:23 -05:00
|
|
|
myGui.CloseToolkit("gocui")
|
|
|
|
doCmd("apt install apt-file")
|
|
|
|
doCmd("apt-file update")
|
2023-04-28 07:26:55 -05:00
|
|
|
doCmd("apt-file -x search /libOpenCL.so.1")
|
|
|
|
// doCmd("apt-file -x search '/libOpenCL.so.1'")
|
2023-04-23 14:41:23 -05:00
|
|
|
os.Exit(0)
|
|
|
|
})
|
|
|
|
|
2024-01-24 22:02:08 -06:00
|
|
|
box.NewButton("install defaults", func() {
|
2023-04-23 14:41:23 -05:00
|
|
|
myGui.CloseToolkit("gocui")
|
|
|
|
doCmd("apt install lsof bash-completion libpam-systemd dbus rbd-nbd golang-go git screen vim " +
|
|
|
|
"ethstatus iftop ethtool sysstat traceroute whois devscripts automake libtool devscripts " +
|
|
|
|
"nmap clang rsync bind9utils dnsutils net-tools tcpdump wget curl iputils-ping pciutils " +
|
|
|
|
"iptables sysbench man usbutils ssh neofetch bc lshw telnet hdparm vrms")
|
|
|
|
os.Exit(0)
|
|
|
|
})
|
|
|
|
}
|