We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 207fc85 commit 8b09976Copy full SHA for 8b09976
1 file changed
debootstrap/bullseye/rootfs/usr/bin/init-stack
@@ -1,5 +1,13 @@
1
#!/bin/bash
2
3
+# check to see if this file is being run or sourced from another script
4
+_is_sourced() {
5
+ # https://unix.stackexchange.com/a/215279
6
+ [ "${#FUNCNAME[@]}" -ge 2 ] \
7
+ && [ "${FUNCNAME[0]}" = '_is_sourced' ] \
8
+ && [ "${FUNCNAME[1]}" = 'source' ]
9
+}
10
+
11
env_list=$(find /opt/drycc/*/env/* 2>/dev/null || echo "")
12
for env in ${env_list}
13
do
@@ -31,8 +39,10 @@ do
31
39
"${_exec}"
32
40
done
33
41
34
-if [[ "$$" == "1" ]] ; then
35
- exec tini -g -- "$@"
36
-else
37
- exec tini -sg -- "$@"
42
+if ! _is_sourced; then
43
+ if [[ "$$" == "1" ]] ; then
44
+ exec tini -g -- "$@"
45
+ else
46
+ exec tini -sg -- "$@"
47
+ fi
38
48
fi
0 commit comments