Skip to content

Commit 5d7ce17

Browse files
committed
fix(cidata): do not overwrite bash in alpine vm
Signed-off-by: Yichen Zhao <[email protected]>
1 parent a00b2a6 commit 5d7ce17

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)