Handle diff nonzero return in set_eula

- Suppress nonzero return code from diff
- Remove false fix `return 0`
This commit is contained in:
Kris Lamoureux 2024-05-26 21:47:55 -04:00
parent c4e3fc042c
commit 695fae915b
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -eux
# Set eula value in eula.txt
set_eula() {
@ -7,9 +7,8 @@ set_eula() {
EULA="${1:-false}"
EULAFILE="${EULAFILE:-/app/eula.txt}"
sed -i.bak "s/^eula=.*\$/eula=${EULA:-false}/" "$EULAFILE"
diff --unified=1 "${EULAFILE}.bak" "$EULAFILE"
diff --unified=1 "${EULAFILE}.bak" "$EULAFILE" || true
rm "${EULAFILE}.bak"
return 0
}
# Update server.properties using env