From 05f5a849ea203d163360e31c6d30aeffd8ff7a4d Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Sun, 23 Nov 2025 14:09:34 +1300 Subject: [PATCH] Bug 16291: remove /etc/koha/sites/$name on koha-remove --purge-all A purge leaves behind some traces in /etc/koha/sites/$name, which can cause problems because the directory isn't deleted. This deletes the whole shebang when purge is requested. Test plan: 1. With the packages installed, make an instance. 2. Make a file in there, e.g. `# cat hello > /etc/koha/sites/$name/foo.txt` 3. Delete the instance with `koha-remove $name --purge-all` 4. Verify that `/etc/koha/sites/$name no longer exists --- debian/scripts/koha-remove | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove index 486b3ff512..e14925867a 100755 --- a/debian/scripts/koha-remove +++ b/debian/scripts/koha-remove @@ -144,6 +144,8 @@ eof rm -r "/var/lib/koha/$name" [ "$purgeall" = "1" ] && [ -d "/var/spool/koha/$name" ] && \ rm -r "/var/spool/koha/$name" + [ "$purgeall" = "1" ] && [ -d "/etc/koha/sites/$name" ] && \ + rm -r "/etc/koha/sites/$name" getent passwd "$name-koha" > /dev/null && deluser --quiet "$name-koha" # in case the site has already been disabled, we don't want to break the loop now. a2dissite "$name" > /dev/null 2>&1 || a2dissite "${name}.conf" > /dev/null 2>&1 || /bin/true -- 2.51.0