35 lines
898 B
Bash
Executable File
35 lines
898 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
apk add nifi nifi-openrc curl
|
|
|
|
test -x /usr/bin/nifi
|
|
test -x /usr/lib/nifi/bin/nifi.sh
|
|
test -d /etc/nifi
|
|
test -L /usr/lib/nifi/conf
|
|
test "$(readlink /usr/lib/nifi/conf)" = /etc/nifi
|
|
test -d /var/lib/nifi
|
|
test -d /var/log/nifi
|
|
test -f /etc/init.d/nifi
|
|
test -f /etc/conf.d/nifi
|
|
test -d /usr/lib/nifi/docs
|
|
test "$(stat -c '%U:%G %a' /var/lib/nifi)" = "nifi:nifi 750"
|
|
|
|
rc-update add nifi default || true
|
|
test -L /etc/runlevels/default/nifi
|
|
rc-service nifi start
|
|
|
|
for _attempt in $(seq 1 300); do
|
|
if curl --fail --insecure --silent --show-error \
|
|
https://localhost:8443/nifi/ >/dev/null; then
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
curl --fail --insecure --silent --show-error https://localhost:8443/nifi/ >/dev/null
|
|
grep -q 'Generated Username' /var/log/nifi/nifi-app.log
|
|
grep -q 'Generated Password' /var/log/nifi/nifi-app.log
|
|
rc-service nifi status
|
|
rc-service nifi stop
|