Skip to content

Commit 188dcb5

Browse files
authored
Merge pull request #2410 from afbjorklund/empty-environment
Handle missing /etc/environment file in boot
2 parents bdc8376 + a503ccd commit 188dcb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/07-etc-environment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eux
44
# /etc/environment must be written after 04-persistent-data-volume.sh has run to
55
# make sure the changes on a restart are applied to the persisted version.
66

7-
orig=$(test -f /etc/environment && cat /etc/environment)
7+
orig=$(test ! -f /etc/environment || cat /etc/environment)
88
if [ -e /etc/environment ]; then
99
sed -i '/#LIMA-START/,/#LIMA-END/d' /etc/environment
1010
fi

0 commit comments

Comments
 (0)