Release LanUps 0.1.2 with native installers and monitoring updates

This commit is contained in:
tongtong committed 2026-11-28 21:18:14 +08:00
1 parent 90c57f020f
commit 5bdc79d8e4
30 files changed
+751 -270

No files matched your search

@@ -0,0 +1,14 @@
#!/bin/sh
set -eu
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
+51
View File
@@ -0,0 +1,51 @@
%global debug_package %{nil}
%global _build_id_links none
%global __strip /bin/true
%global __provides_exclude_from ^/opt/lanups/
Name: lanups
Version: %{lanups_version}
Release: 1
Summary: LAN UPS Agent and desktop monitor
License: Unspecified
Source0: lanups-payload.tar.gz
Requires(post): coreutils, glibc-common, shadow-utils, systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: openssl-libs, libicu, libX11, libX11-xcb, libxcb, libXext, libXi, libXrandr, libICE, libSM, fontconfig, libglvnd-glx
%description
LanUps monitors a network UPS and provides a local desktop application and system service.
%install
mkdir -p "%{buildroot}/usr/lib/systemd/system"
tar -xzf "%{SOURCE0}" -C "%{buildroot}"
mv "%{buildroot}/lib/systemd/system/lanups-agent.service" "%{buildroot}/usr/lib/systemd/system/"
%post
set -e
/usr/lib/lanups/configure-agent
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
systemctl enable lanups-agent.service
systemctl restart lanups-agent.service
else
systemctl --root=/ enable lanups-agent.service
fi
%preun
if [ "$1" -eq 0 ]; then
if [ -d /run/systemd/system ]; then systemctl stop lanups-agent.service || :; fi
systemctl --root=/ disable lanups-agent.service || :
fi
%postun
if [ "$1" -eq 0 ] && [ -d /run/systemd/system ]; then systemctl daemon-reload || :; fi
%files
/opt/lanups
/usr/lib/lanups
/usr/lib/systemd/system/lanups-agent.service
/etc/xdg/autostart/lanups-desktop.desktop
/usr/share/applications/lanups-desktop.desktop
/usr/share/icons/hicolor/256x256/apps/lanups.png
+1 -12
View File
@@ -1,18 +1,7 @@
#!/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
/usr/lib/lanups/configure-agent
if command -v systemctl >/dev/null; then
systemctl enable lanups-agent.service