mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-03 03:16:10 -06:00
docker-entrypoint.sh: fix shellcheck issues
issues found by shellcheck were:
```
$ shellcheck docker-entrypoint.sh
In docker-entrypoint.sh line 10:
if [[ ${USERMAP_UID} != ${USERMAP_ORIG_UID} || ${USERMAP_GID} != ${USERMAP_ORIG_GID} ]]; then
^-- SC2053: Quote the rhs of != in [[ ]] to prevent glob matching.
^-- SC2053: Quote the rhs of != in [[ ]] to prevent glob matching.
In docker-entrypoint.sh line 12:
groupmod -g ${USERMAP_GID} paperless
^-- SC2086: Double quote to prevent globbing and word splitting.
In docker-entrypoint.sh line 65:
if dpkg -s "$pkg" 2>&1 > /dev/null; then
^-- SC2069: The order of the 2>&1 and the redirect matters. The 2>&1 has to be last.
In docker-entrypoint.sh line 69:
if ! apt-cache show "$pkg" 2>&1 > /dev/null; then
^-- SC2069: The order of the 2>&1 and the redirect matters. The 2>&1 has to be last.
```
This commit is contained in:
@@ -7,9 +7,9 @@ map_uidgid() {
|
||||
USERMAP_ORIG_UID=$(id -g paperless)
|
||||
USERMAP_GID=${USERMAP_GID:-${USERMAP_UID:-$USERMAP_ORIG_GID}}
|
||||
USERMAP_UID=${USERMAP_UID:-$USERMAP_ORIG_UID}
|
||||
if [[ ${USERMAP_UID} != ${USERMAP_ORIG_UID} || ${USERMAP_GID} != ${USERMAP_ORIG_GID} ]]; then
|
||||
if [[ ${USERMAP_UID} != "${USERMAP_ORIG_UID}" || ${USERMAP_GID} != "${USERMAP_ORIG_GID}" ]]; then
|
||||
echo "Mapping UID and GID for paperless:paperless to $USERMAP_UID:$USERMAP_GID"
|
||||
groupmod -g ${USERMAP_GID} paperless
|
||||
groupmod -g "${USERMAP_GID}" paperless
|
||||
sed -i -e "s|:${USERMAP_ORIG_UID}:${USERMAP_GID}:|:${USERMAP_UID}:${USERMAP_GID}:|" /etc/passwd
|
||||
fi
|
||||
}
|
||||
@@ -62,11 +62,11 @@ install_languages() {
|
||||
# Loop over languages to be installed
|
||||
for lang in "${langs[@]}"; do
|
||||
pkg="tesseract-ocr-$lang"
|
||||
if dpkg -s "$pkg" 2>&1 > /dev/null; then
|
||||
if dpkg -s "$pkg" > /dev/null 2>&1; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! apt-cache show "$pkg" 2>&1 > /dev/null; then
|
||||
if ! apt-cache show "$pkg" > /dev/null 2>&1; then
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user