Skip to content

Commit 3ec8870

Browse files
committed
Fix <<< syntax not supported in some shells.
1 parent 0562a4d commit 3ec8870

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ run_with_timeout() {
124124

125125
local count=0
126126
while [ $count -lt "$timeout" ] && kill -0 "$pid" 2>/dev/null; do
127-
sleep 1
128-
count=$((count + 1))
127+
sleep 1
128+
count=$((count + 1))
129129
done
130130

131131
if kill -0 "$pid" 2>/dev/null; then
132-
kill -TERM "$pid"
133-
wait "$pid" 2>/dev/null
134-
cat "$tmpfile"
135-
rm -f "$tmpfile"
136-
return 124 # Timeout
132+
kill -TERM "$pid"
133+
wait "$pid" 2>/dev/null
134+
cat "$tmpfile"
135+
rm -f "$tmpfile"
136+
return 124 # Timeout
137137
fi
138138

139139
wait "$pid"
@@ -159,18 +159,18 @@ check_requirements() {
159159
# Check that Docker/Podman is running and the user has permissions to use it.
160160
if ! output=$(run_with_timeout 10 $container_tool ps); then
161161
log_error "$container_tool is either not running or this user doesn't have permission to use $container_tool. Make sure $container_tool is started. If $container_tool is running, it is likely the user doesn't have permission to use $container_tool. Either run the script as root or contact your system administrator. Output:"
162-
while IFS= read -r line; do
162+
printf '%s\n' "$output" | while IFS= read -r line; do
163163
log_error " $line"
164-
done <<< "$output"
164+
done
165165
exit 1
166166
fi
167167

168168
# Check if Docker Compose or Podman-Compose is installed.
169169
if ! output=$(run_with_timeout 10 $compose_tool version); then
170170
log_error "$container_tool is installed but $compose_tool is not. Please install $compose_tool first. Output:"
171-
while IFS= read -r line; do
171+
printf '%s\n' "$output" | while IFS= read -r line; do
172172
log_error " $line"
173-
done <<< "$output"
173+
done
174174
[ "$container_tool" = "docker" ] && log_info "Visit https://docs.docker.com/compose/install/ for installation instructions."
175175
exit 1
176176
fi
@@ -318,9 +318,9 @@ deploy_containers() {
318318
log_info "Pulling latest container images."
319319
if ! output=$(run_with_timeout 300 $compose_tool pull); then
320320
log_error "Failed to pull container images. Output:"
321-
while IFS= read -r line; do
321+
printf '%s\n' "$output" | while IFS= read -r line; do
322322
log_error " $line"
323-
done <<< "$output"
323+
done
324324
exit 1
325325
fi
326326

0 commit comments

Comments
 (0)