32 lines
857 B
Bash
32 lines
857 B
Bash
#!/bin/sh
|
|
# douninst.sh - Post-removal script for gitea
|
|
#
|
|
# Removes package files and directories.
|
|
# Preserves: git user, git group, and user repositories.
|
|
|
|
# Remove binary
|
|
rm -f /usr/bin/gitea
|
|
|
|
# Remove rc script
|
|
rm -f /etc/rc.d/rc.gitea
|
|
|
|
# Remove config directory (includes app.ini)
|
|
rm -rf /etc/gitea
|
|
|
|
# Remove custom files and logs (but not repository data)
|
|
rm -rf /var/lib/gitea/custom
|
|
rm -rf /var/lib/gitea/log
|
|
|
|
# Remove data dir contents EXCEPT gitea-repositories/
|
|
if [ -d /var/lib/gitea/data ]; then
|
|
find /var/lib/gitea/data -mindepth 1 -maxdepth 1 \
|
|
! -name "gitea-repositories" -exec rm -rf {} +
|
|
# Remove data/ only if empty (repositories dir may remain)
|
|
rmdir /var/lib/gitea/data 2>/dev/null
|
|
fi
|
|
|
|
# Remove top-level gitea dir only if empty
|
|
rmdir /var/lib/gitea 2>/dev/null
|
|
|
|
# Documentation is removed automatically by removepkg
|