aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/init0/early.go
blob: 0bcf094c65caaa9687b490902c218df65abc6d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package init0

import (
	"os"
	"path"

	"git.gensokyo.uk/security/fortify/internal"
)

// used by the parent process

// TryArgv0 calls [Main] if the last element of argv0 is "init0".
func TryArgv0() {
	if len(os.Args) > 0 && path.Base(os.Args[0]) == "init0" {
		Main()
		internal.Exit(0)
	}
}