2021-11-09 11:37:51 +00:00
|
|
|
//go:build !windows && !darwin && !linux
|
2018-05-01 23:45:06 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2025-01-19 18:05:12 +00:00
|
|
|
"fmt"
|
2018-05-01 23:45:06 +00:00
|
|
|
"os"
|
|
|
|
|
2025-01-20 22:13:45 +00:00
|
|
|
cli "github.com/urfave/cli/v2"
|
2025-01-20 20:11:19 +00:00
|
|
|
|
2025-01-20 22:10:15 +00:00
|
|
|
"github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil"
|
2018-05-01 23:45:06 +00:00
|
|
|
)
|
|
|
|
|
2021-02-19 22:06:57 +00:00
|
|
|
func runApp(app *cli.App, graceShutdownC chan struct{}) {
|
2025-01-19 18:05:12 +00:00
|
|
|
app.Commands = append(app.Commands, &cli.Command{
|
|
|
|
Name: "service",
|
|
|
|
Usage: "Manages the cloudflared system service (not supported on this operating system)",
|
|
|
|
Subcommands: []*cli.Command{
|
|
|
|
{
|
|
|
|
Name: "install",
|
|
|
|
Usage: "Install cloudflared as a system service (not supported on this operating system)",
|
|
|
|
Action: cliutil.ConfiguredAction(installGenericService),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "uninstall",
|
|
|
|
Usage: "Uninstall the cloudflared service (not supported on this operating system)",
|
|
|
|
Action: cliutil.ConfiguredAction(uninstallGenericService),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2018-05-01 23:45:06 +00:00
|
|
|
app.Run(os.Args)
|
|
|
|
}
|
2025-01-19 18:05:12 +00:00
|
|
|
|
|
|
|
func installGenericService(c *cli.Context) error {
|
|
|
|
return fmt.Errorf("service installation is not supported on this operating system")
|
|
|
|
}
|
|
|
|
|
|
|
|
func uninstallGenericService(c *cli.Context) error {
|
|
|
|
return fmt.Errorf("service uninstallation is not supported on this operating system")
|
|
|
|
}
|