skyview/debian/DEBIAN/postinst
Ole-Morten Duesund 721c1ca3a2 Remove build artifacts from repository and improve Debian package installation
- Remove debian/usr/bin/beast-dump from git tracking (build artifact)
- Add debian/usr/bin/* to .gitignore to prevent future binary commits
- Update postinst script for quiet installation:
  - Add --quiet flags to adduser/addgroup commands
  - Suppress output from directory creation and permission setting
  - Smart service handling: restart if enabled, leave disabled otherwise
  - Remove verbose installation messages
- Binaries are now built only during package creation, not stored in repo

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 18:46:37 +02:00

39 lines
No EOL
1.3 KiB
Bash
Executable file

#!/bin/bash
set -e
case "$1" in
configure)
# Create skyview user and group if they don't exist
if ! getent group skyview >/dev/null 2>&1; then
addgroup --system --quiet skyview
fi
if ! getent passwd skyview >/dev/null 2>&1; then
adduser --system --ingroup skyview --home /var/lib/skyview \
--no-create-home --disabled-password --quiet skyview
fi
# Create directories with proper permissions
mkdir -p /var/lib/skyview /var/log/skyview >/dev/null 2>&1 || true
chown skyview:skyview /var/lib/skyview /var/log/skyview >/dev/null 2>&1 || true
chmod 755 /var/lib/skyview /var/log/skyview >/dev/null 2>&1 || true
# Set permissions on config files
if [ -f /etc/skyview/config.json ]; then
chown root:skyview /etc/skyview/config.json >/dev/null 2>&1 || true
chmod 640 /etc/skyview/config.json >/dev/null 2>&1 || true
fi
# Handle systemd service
systemctl daemon-reload >/dev/null 2>&1 || true
# Check if service was previously enabled
if systemctl is-enabled skyview >/dev/null 2>&1; then
# Service was enabled, restart it
systemctl restart skyview >/dev/null 2>&1 || true
fi
;;
esac
exit 0