From f4cfc77a577e0dfd152878830294c8eb3fe47861 Mon Sep 17 00:00:00 2001 From: Jayryn <77808206+Jayryn@users.noreply.github.com> Date: Tue, 28 May 2024 09:14:30 +0200 Subject: [PATCH] Check if database symlink already exists test -L $object [object exists and is a symbolic link (same as -h)] It is not recommended to use -h [True if file exists and is a symbolic link. This operator is retained for compatibility with previous versions of this program. Do not rely on its existence; use -L instead.] --- debian/postinst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index f82cbfff..223d322b 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,8 +25,10 @@ case "$1" in # and permissions for the config. mkdir -v -p "$CONDUWUIT_DATABASE_PATH" - # symlink the previous location for compatibility - ln -s -v "$CONDUWUIT_DATABASE_PATH" "/var/lib/matrix-conduit" + # symlink the previous location for compatibility if it does not exist yet. + if ! test -L "/var/lib/matrix-conduit" ; then + ln -s -v "$CONDUWUIT_DATABASE_PATH" "/var/lib/matrix-conduit" + fi chown -v conduwuit:conduwuit -R "$CONDUWUIT_DATABASE_PATH" chown -v conduwuit:conduwuit -R "$CONDUWUIT_CONFIG_PATH"