Initial LanUps implementation and native installers
This commit is contained in:
commit
67a043c89b
66 files changed
+2870
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user