#!/usr/bin/with-contenv bash

# Create folders
mkdir -p \
    /data \
    /tmp/.dotnet/shm

# check Library permissions
PUID=${PUID:-911}
if [ -d /config/config ] && [ ! "$(stat -c %u /config/config)" = "$PUID" ]; then
    echo "Change in ownership detected, please be patient while we chown existing files"
    echo "This could take some time"
    lsiown abc:abc -R \
        /config
fi
lsiown abc:abc /tmpnetcore
chmod 777 /tmp/{.dotnet,.dotnet/shm}
