diff --git a/package/sentinèlla/probe-loop.sh b/package/sentinèlla/probe-loop.sh index cbb6a7f..e8baab4 100644 --- a/package/sentinèlla/probe-loop.sh +++ b/package/sentinèlla/probe-loop.sh @@ -96,8 +96,8 @@ base64() { esac } -TIMEOUT=${TIMEOUT:-5} -[ -n "$VOLUMES" ] || VOLUMES=$(df -P | awk 'NR>1{print $6}') +: "${TIMEOUT:=5}" +: "${VOLUMES:=$(df -P | awk 'NR>1{print $6}')}" route_status() { if [ -z "$URLS" ]; then @@ -138,7 +138,7 @@ route_disk() { } AUTH_TOKENS="" -if [ -n "$AUTH_FILE" ] && [ -r "$AUTH_FILE" ]; then +if [ -n "${AUTH_FILE:-}" ] && [ -r "$AUTH_FILE" ]; then while IFS= read -r up || [ -n "$up" ]; do [ -n "$up" ] || continue AUTH_TOKENS="$AUTH_TOKENS $(base64 encode "$up" | tail -n1)" diff --git a/package/sentinèlla/probe.sh b/package/sentinèlla/probe.sh index 4d4addc..ffeb0d1 100644 --- a/package/sentinèlla/probe.sh +++ b/package/sentinèlla/probe.sh @@ -1,6 +1,16 @@ #!/usr/bin/env dash + +# +# +# +# +# +# +# +# + set -euo pipefail socat -V >/dev/null dash -c 'echo ok' >/dev/null -socat -T5 -t5 TCP-LISTEN:"${PORT:-5988}",reuseaddr,fork EXEC:"dash ${LOOP_FILE:-probe-loop}" +socat -T5 -t5 TCP-LISTEN:"${PORT:-5988}",reuseaddr,fork EXEC:"probe-loop"