mirror of
https://github.com/VaalaCat/frp-panel.git
synced 2026-04-22 23:17:23 +08:00
16 lines
386 B
Go
16 lines
386 B
Go
package upgrade
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
)
|
|
|
|
func defaultWorkDir() string {
|
|
// 对于 systemd 场景,优先使用持久目录,方便 upgrader service 读取 plan/status
|
|
if runtime.GOOS == "linux" && os.Geteuid() == 0 {
|
|
return filepath.Join(string(os.PathSeparator), "etc", "frpp", "upgrade")
|
|
}
|
|
return filepath.Join(os.TempDir(), "vaala-frp-panel-upgrade")
|
|
}
|