new: move running admin service to core

This commit is contained in:
Hiddify
2024-02-05 18:47:26 +01:00
parent 1a31b04e29
commit d96279386a
12 changed files with 234 additions and 40 deletions

View File

@@ -156,7 +156,7 @@ func startService(delayStart bool) error {
return fmt.Errorf("error building config: %w", err)
}
config.SaveCurrentConfig(sWorkingPath, *patchedOptions)
config.SaveCurrentConfig(filepath.Join(sWorkingPath, "current-config.json"), *patchedOptions)
err = startCommandServer(*logFactory)
if err != nil {
@@ -188,6 +188,7 @@ func stop() (CErr *C.char) {
defer config.DeferPanicToError("stop", func(err error) {
CErr = C.CString(err.Error())
})
config.DeactivateTunnelService()
if status != Started {
return C.CString("")