services-garbaye/podman-seafile/update-seahub-media.sh
2021-09-18 11:38:09 +02:00

20 lines
643 B
Bash
Executable file

#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
rm -rf /tmp/seahub
su - podman-seafile -c "podman cp seafile:/opt/seafile/seafile-server-latest/seahub /tmp"
mkdir -p /var/www/seafile/seafile-server-latest/
rm -rf /var/www/seafile/seafile-server-latest/seahub
mv -v /tmp/seahub /var/www/seafile/seafile-server-latest/
rm -rf /var/www/seafile/seahub-data
rsync -av --exclude 'thumbnail' ~podman-seafile/.local/share/containers/storage/volumes/podman-seafile_seafile-data/_data/seafile/seahub-data /var/www/seafile/
restorecon -RF /var/www/seafile
chown -R nginx:nginx /var/www/seafile