admin-log: adapt clementine tip/vs content onto main

This commit is contained in:
Hernâni Marques 2026-09-07 17:43:45 +02:00
parent ba863f8a93
commit d8dbc6242b
No known key found for this signature in database
7 changed files with 111 additions and 23 deletions

View file

@ -1,12 +1,21 @@
#!/usr/bin/env bash
# Install Lemmy user systemd units on koopa (boot via linger).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
HERE="$(cd "$(dirname "$0")" && pwd)"
LIVE="${HOME}/koopa-lemmy"
if [ -f "${HERE}/../../configs/lemmy/container-koopa-lemmy.service" ]; then
UNIT_SRC="${HERE}/../../configs/lemmy"
elif [ -f "${LIVE}/container-koopa-lemmy.service" ]; then
UNIT_SRC="${LIVE}"
else
echo "ERROR: lemmy unit files not found" >&2
exit 1
fi
UNIT_DIR="${HOME}/.config/systemd/user"
mkdir -p "${UNIT_DIR}"
cp "${ROOT}/configs/lemmy/container-koopa-lemmy-db.service" "${UNIT_DIR}/"
cp "${ROOT}/configs/lemmy/container-koopa-lemmy.service" "${UNIT_DIR}/"
cp "${UNIT_SRC}/container-koopa-lemmy-db.service" "${UNIT_DIR}/"
cp "${UNIT_SRC}/container-koopa-lemmy.service" "${UNIT_DIR}/"
systemctl --user daemon-reload
systemctl --user enable \
@ -25,4 +34,13 @@ systemctl --user --no-pager --lines=0 status \
container-koopa-lemmy-db.service \
container-koopa-lemmy.service || true
if command -v loginctl >/dev/null 2>&1; then
if [ "$(loginctl show-user "$(id -un)" -p Linger --value 2>/dev/null || echo no)" != "yes" ]; then
echo "NOTE: enable linger so units start after reboot without login:"
echo " sudo loginctl enable-linger $(id -un)"
else
echo "linger already enabled for $(id -un)"
fi
fi
echo "OK. Public: https://lemmy.hacktivism.ch/"