2023-01-24 20:31:32 -08:00
|
|
|
{{- if (ne .host.distro.family "windows") -}}
|
2023-01-24 20:43:02 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
### Ensure /tmp/tmp-profile is created and owned by root
|
2023-01-24 21:03:11 -08:00
|
|
|
if [ ! -f /tmp/tmp-profile ]; then
|
|
|
|
# Add pre-scaffolding profile to /tmp/tmp-profile so it's easier to navigate through scripts
|
2023-01-24 21:06:59 -08:00
|
|
|
cat <<'EOF' > /tmp/tmp-profile
|
|
|
|
{{ includeTemplate "universal/profile-inline" }}
|
|
|
|
EOF
|
2023-01-24 20:43:02 -08:00
|
|
|
|
2023-01-24 21:03:11 -08:00
|
|
|
# Make /tmp/tmp-profile owned by root to prevent tampering
|
|
|
|
sudo chown root /tmp/tmp-profile
|
|
|
|
fi
|
2023-01-24 20:31:32 -08:00
|
|
|
|
2023-01-24 20:43:02 -08:00
|
|
|
### Ensure /tmp/tmp-logg is created and owned by root
|
2023-01-24 21:03:11 -08:00
|
|
|
if [ ! -f /tmp/tmp-logg ]; then
|
|
|
|
# Add pre-scaffolding /tmp/tmp-logg
|
2023-01-24 21:06:59 -08:00
|
|
|
cat <<'EOF' > /tmp/tmp-logg
|
|
|
|
{{ includeTemplate "universal/logg-inline" }}
|
|
|
|
EOF
|
2023-01-24 20:43:02 -08:00
|
|
|
|
2023-01-24 21:03:11 -08:00
|
|
|
# Make /tmp/tmp-logg owned by root to prevent tampering
|
|
|
|
sudo chown root /tmp/tmp-logg
|
|
|
|
fi
|
2023-01-24 20:31:32 -08:00
|
|
|
|
2023-01-24 20:52:47 -08:00
|
|
|
{{ end -}}
|