Move LanUps under the TTSDream repository root

This commit is contained in:
tongtong committed 2026-11-28 16:29:25 +08:00
1 parent 67a043c89b
commit 90c57f020f
66 files changed

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
[ "${1:-}" = configure ] || exit 0
data=/etc/LanUps
token=$data/agent.token
group=lanups-operators
install -d -m 0755 -o root -g root "$data"
getent group "$group" >/dev/null || groupadd --system "$group"
if [ ! -f "$token" ]; then LANUPS_AGENT_TOKEN="$token" /opt/lanups/agent/LanUps.Agent --provision; fi
chown root:"$group" "$token"
chmod 0640 "$token"
operator=${SUDO_USER:-}
if [ -z "$operator" ] || [ "$operator" = root ]; then operator=$(getent passwd 1000 | cut -d: -f1); fi
if [ -n "$operator" ] && [ "$(id -u "$operator")" -ge 1000 ]; then usermod -a -G "$group" "$operator"; fi
if command -v systemctl >/dev/null; then
systemctl enable lanups-agent.service
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
deb-systemd-invoke restart lanups-agent.service
fi
fi