Making config directory during repair, but only if the media directory is mounted and empty.

This commit is contained in:
Roland 2024-03-16 19:57:01 -06:00
parent 947135985d
commit 56d430df22
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -119,6 +119,10 @@ systemctl enable renderd
# Create the media directory. This should be mounted by the maintainer.
[ -d /media/wrolpi ] || mkdir /media/wrolpi
# Create config directory if external drive is mounted, and is empty.
if grep -qs /media/wrolpi /proc/mounts && [ -z "$(ls -A /media/wrolpi)" ] && [ ! -d /media/wrolpi/config ]; then
mkdir /media/wrolpi/config
fi
chown wrolpi:wrolpi /media/wrolpi
chown -R wrolpi:wrolpi /home/wrolpi /opt/wrolpi*