forked from mtusi2026/mtusi2026lab7
14 lines
350 B
Bash
Executable File
14 lines
350 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
: "${LAB7_HOOK_DIR:?run through scripts/test-resilience.ps1}"
|
|
printf '%s\n' "$1" > "$LAB7_HOOK_DIR/request.tmp"
|
|
mv "$LAB7_HOOK_DIR/request.tmp" "$LAB7_HOOK_DIR/request"
|
|
for i in $(seq 1 85); do
|
|
if [ -f "$LAB7_HOOK_DIR/result" ]; then
|
|
test "$(cat "$LAB7_HOOK_DIR/result")" = 0
|
|
exit
|
|
fi
|
|
sleep 1
|
|
done
|
|
exit 1
|