skyview/debian/DEBIAN/postinst

49 lines
1.5 KiB
Text
Raw Normal View History

#!/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 skyview
fi
if ! getent passwd skyview >/dev/null 2>&1; then
adduser --system --ingroup skyview --home /var/lib/skyview \
--no-create-home --disabled-password skyview
fi
# Create directories with proper permissions
mkdir -p /var/lib/skyview
mkdir -p /var/log/skyview
chown skyview:skyview /var/lib/skyview
chown skyview:skyview /var/log/skyview
chmod 755 /var/lib/skyview
chmod 755 /var/log/skyview
# Set permissions on config files
if [ -f /etc/skyview/config.json ]; then
chown root:skyview /etc/skyview/config.json
chmod 640 /etc/skyview/config.json
fi
# Install systemd service but do not enable or start it
systemctl daemon-reload
echo "SkyView has been installed successfully."
echo ""
echo "Configuration:"
echo " - Main config: /etc/skyview/config.json"
echo ""
echo "To start SkyView:"
echo " sudo systemctl enable skyview"
echo " sudo systemctl start skyview"
echo ""
echo "Binaries installed:"
echo " - skyview: Main ADS-B tracker server"
echo " - beast-dump: Beast protocol data dump utility"
;;
esac
exit 0