fix chassis detection with hostnamectl
This commit is contained in:
parent
1110cb3dc7
commit
0ef9b714ec
|
@ -22,10 +22,10 @@
|
||||||
{{- $chassisType = "desktop" }}
|
{{- $chassisType = "desktop" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if eq .chezmoi.os "linux" }}
|
{{- else if eq .chezmoi.os "linux" }}
|
||||||
{{- $chassisType = or (and
|
{{- $chassisType = (and
|
||||||
(lookPath "hostnamectl") (output "hostnamectl" "--json=short" | mustFromJson).Chassis
|
(lookPath "hostnamectl")
|
||||||
)
|
( regexReplaceAll "Chassis:\\s*" (regexFind "Chassis:\\s*\\S+" (output "hostnamectl" "status")) "" )
|
||||||
"server"
|
) | default "server"
|
||||||
}}
|
}}
|
||||||
{{- else if eq .chezmoi.os "windows" }}
|
{{- else if eq .chezmoi.os "windows" }}
|
||||||
{{- $sysType = "windows" }}
|
{{- $sysType = "windows" }}
|
||||||
|
|
Loading…
Reference in New Issue