2023-01-25 04:31:32 +00:00
|
|
|
{{- if (ne .host.distro.family "windows") -}}
|
2023-01-25 04:43:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
### Ensure /tmp/tmp-profile is created and owned by root
|
2023-01-25 05:03:11 +00: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-25 05:06:59 +00:00
|
|
|
cat <<'EOF' > /tmp/tmp-profile
|
|
|
|
{{ includeTemplate "universal/profile-inline" }}
|
|
|
|
EOF
|
2023-01-25 04:43:02 +00:00
|
|
|
|
2023-01-25 05:03:11 +00:00
|
|
|
# Make /tmp/tmp-profile owned by root to prevent tampering
|
|
|
|
sudo chown root /tmp/tmp-profile
|
|
|
|
fi
|
2023-01-25 04:31:32 +00:00
|
|
|
|
2023-01-25 04:43:02 +00:00
|
|
|
### Ensure /tmp/tmp-logg is created and owned by root
|
2023-01-25 05:03:11 +00:00
|
|
|
if [ ! -f /tmp/tmp-logg ]; then
|
|
|
|
# Add pre-scaffolding /tmp/tmp-logg
|
2023-01-25 05:06:59 +00:00
|
|
|
cat <<'EOF' > /tmp/tmp-logg
|
|
|
|
{{ includeTemplate "universal/logg-inline" }}
|
|
|
|
EOF
|
2023-01-25 04:43:02 +00:00
|
|
|
|
2023-01-25 05:03:11 +00:00
|
|
|
# Make /tmp/tmp-logg owned by root to prevent tampering
|
|
|
|
sudo chown root /tmp/tmp-logg
|
|
|
|
fi
|
2023-01-25 04:31:32 +00:00
|
|
|
|
2023-01-25 04:52:47 +00:00
|
|
|
{{ end -}}
|