MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / validateScriptPath

Function validateScriptPath

internal/plugins/communityscripts/scripts.go:562–569  ·  view source on GitHub ↗

InstallScript installs a script on a Proxmox node interactively.

(scriptPath string)

Source from the content-addressed store, hash-verified

560
561// InstallScript installs a script on a Proxmox node interactively.
562func validateScriptPath(scriptPath string) error {
563 for _, c := range scriptPath {
564 if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '/' || c == '.' || c == '_' || c == '-') {
565 return fmt.Errorf("invalid script path character: %c", c)
566 }
567 }
568 return nil
569}
570
571// ParseEnvOverride parses and validates a KEY=VALUE Community Scripts override.
572func ParseEnvOverride(raw string) (EnvOverride, error) {

Callers 2

InstallScriptInLXCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected