delete old codes

This commit is contained in:
Alireza Ahmadi
2025-01-06 00:08:27 +01:00
parent 8bab127f19
commit 8073e8ab0a
6 changed files with 2 additions and 83 deletions
-24
View File
@@ -14,9 +14,6 @@ var version string
//go:embed name
var name string
//go:embed config.json
var defaultConfig string
type LogLevel string
const (
@@ -72,24 +69,3 @@ func GetDBFolderPath() string {
func GetDBPath() string {
return fmt.Sprintf("%s/%s.db", GetDBFolderPath(), GetName())
}
func GetDefaultConfig() string {
apiEnv := GetEnvApi()
if len(apiEnv) > 0 {
return strings.Replace(defaultConfig, "127.0.0.1:1080", apiEnv, 1)
}
return defaultConfig
}
func GetEnvApi() string {
return os.Getenv("SINGBOX_API")
}
func IsSystemd() bool {
pid := os.Getppid()
cmdline, err := os.ReadFile(fmt.Sprintf("/proc/%d/comm", pid))
if err != nil {
return false
}
return string(cmdline) == "systemd\n"
}