dbde9b3cab
I completed the process of generating the configuration file for idiots like me who like to delete configuration files. Don't worry, it's only by accident ;) I also modified main.go so that the generating process actually becomes useful. What happens is that the program checks if the configuration file exists (which will have to change to become more modular as I have it set to look in the current directory you're in) and if it doesn't, it goes ahead creates it and inputs some random junk in there that is actually supposed to help with your own configuration.
20 lines
427 B
Go
20 lines
427 B
Go
package main
|
|
|
|
import "log"
|
|
|
|
func main() {
|
|
isCreated := doesConfigExist()
|
|
|
|
if isCreated == false {
|
|
createTemplateConfig(isCreated)
|
|
writeTemplateConfig("config.yaml")
|
|
}
|
|
|
|
config := initializeConfig("config.yaml")
|
|
sshConn, sshConfig := initializeConnection(config)
|
|
clientConns := sshConn.dialConnection(sshConfig)
|
|
_ = sshConn.openSession(clientConns)
|
|
success := sshConn.executeSFTP(clientConns)
|
|
log.Println(success)
|
|
}
|