services-garbaye/podman-seafile/update-seahub-media.sh

20 lines
618 B
Bash
Raw Normal View History

2021-05-26 20:11:53 +00:00
#!/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
cp -a ~podman-seafile/.local/share/containers/storage/volumes/seafile-compose_seafile-data/_data/seafile/seahub-data /var/www/seafile/
restorecon -RF /var/www/seafile
chown -R nginx:nginx /var/www/seafile