STICmd *exec.Cmd
MyID string
Connected bool
+ Events *Events
// Private fields
binDir string
logsDir string
exitSTChan chan ExitChan
exitSTIChan chan ExitChan
- conf *xdsconfig.Config
client *common.HTTPClient
log *logrus.Logger
- Events *Events
+ conf *xdsconfig.Config
}
// ExitChan Channel used for process exit
// Kill existing process (useful for debug ;-) )
if os.Getenv("DEBUG_MODE") != "" {
- exec.Command("bash", "-c", "pkill -9 "+exeName).Output()
+ fmt.Printf("\n!!! DEBUG_MODE set: KILL existing %s process(es) !!!\n", exeName)
+ exec.Command("bash", "-c", "ps -ax |grep "+exeName+" |grep "+s.BaseURL+" |cut -d' ' -f 1|xargs -I{} kill -9 {}").Output()
}
// When not set (or set to '.') set bin to path of xds-agent executable
"strings"
"github.com/iotbzh/xds-server/lib/folder"
- "github.com/syncthing/syncthing/lib/config"
+ stconfig "github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/protocol"
)
return "", err
}
- newDevice := config.DeviceConfiguration{
+ newDevice := stconfig.DeviceConfiguration{
DeviceID: devID,
Name: stClientID,
Addresses: []string{"dynamic"},
id = stClientID[0:15] + "_" + label
}
- folder := config.FolderConfiguration{
+ folder := stconfig.FolderConfiguration{
ID: id,
Label: label,
Path: filepath.Join(s.conf.FileConf.ShareRootDir, f.ClientPath),
folder.RescanIntervalS = s.conf.FileConf.SThgConf.RescanIntervalS
}
- folder.Devices = append(folder.Devices, config.FolderDeviceConfiguration{
+ folder.Devices = append(folder.Devices, stconfig.FolderDeviceConfiguration{
DeviceID: newDevice.DeviceID,
})
found = false
- var fld config.FolderConfiguration
+ var fld stconfig.FolderConfiguration
for _, fld = range stCfg.Folders {
if folder.ID == fld.ID {
fld = folder
}
// FolderConfigGet Returns the configuration of a specific folder
-func (s *SyncThing) FolderConfigGet(folderID string) (config.FolderConfiguration, error) {
- fc := config.FolderConfiguration{}
+func (s *SyncThing) FolderConfigGet(folderID string) (stconfig.FolderConfiguration, error) {
+ fc := stconfig.FolderConfiguration{}
if folderID == "" {
return fc, fmt.Errorf("folderID not set")
}