Use modern bash 4.0+ conditional style

This commit is contained in:
Nick Sweeting 2020-07-21 16:14:54 -04:00 committed by GitHub
parent 6e8e3c69fd
commit fa771c9505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,10 +14,9 @@ COMMAND="$@"
chown "$USID":"$GRID" "$DATA_DIR"
if [ $USID -ne 0 ] && [ $GRID -ne 0 ]
then
chown -R "$USID":"$GRID" "/home/$ARCHIVEBOX_USER"
usermod -u $USID $ARCHIVEBOX_USER
groupmod -g $GRID $ARCHIVEBOX_USER
if [[ "$USID" != 0 && "$GRID" != 0 ]]; then
usermod -u $USID $ARCHIVEBOX_USER
groupmod -g $GRID $ARCHIVEBOX_USER
chown -R "$USID":"$GRID" "/home/$ARCHIVEBOX_USER"
fi
gosu $ARCHIVEBOX_USER bash -c "$COMMAND"