Skip to content

Commit 1435079

Browse files
authored
Merge pull request #3557 from ycdzj/fix/alpine_bash
fix(cidata): do not overwrite bash in alpine vm
2 parents 0f71d32 + 5d7ce17 commit 1435079

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/01-alpine-ash-as-bash.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# cloud-init scripts can use `#!/bin/bash` and `set -o pipefail`.
88
test -f /etc/alpine-release || exit 0
99

10+
# If bash already exists, do nothing.
11+
test -x /bin/bash && exit 0
12+
1013
# Redirect bash to ash (built with CONFIG_ASH_BASH_COMPAT) and hope for the best :)
1114
# It does support `set -o pipefail`, but not `[[`.
1215
# /bin/bash can't be a symlink because /bin/ash is a symlink to /bin/busybox

0 commit comments

Comments
 (0)