MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / needInit

Function needInit

agent/init/firewall/firewall.go:113–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111}
112
113func needInit() bool {
114 file, err := os.OpenFile("/run/1panel_boot_mark", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0644)
115 if err != nil {
116 if os.IsExist(err) {
117 return false
118 }
119 global.LOG.Errorf("check boot mark file failed: %v", err)
120 return true
121 }
122 defer file.Close()
123 fmt.Fprintf(file, "Boot Mark for 1panel\n")
124 return true
125}
126
127func InitPingStatus() {
128 global.LOG.Info("initializing ban ping status from settings...")

Callers 1

InitFunction · 0.85

Calls 3

OpenFileMethod · 0.80
IsExistMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected