Skip to content

Commit a503ccd

Browse files
committed
Handle missing /etc/environment file in boot
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 203a60e commit a503ccd

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)