27 lines
738 B
Bash
Executable File
27 lines
738 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Post-removal script
|
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
|
|
# Stop and disable service
|
|
systemctl stop oculog-client.service 2>/dev/null || true
|
|
systemctl disable oculog-client.service 2>/dev/null || true
|
|
|
|
# Remove service file
|
|
rm -f /etc/systemd/system/oculog-client.service
|
|
systemctl daemon-reload
|
|
|
|
# Remove symlink
|
|
rm -f /usr/local/bin/oculog-client
|
|
|
|
if [ "$1" = "purge" ]; then
|
|
# Remove configuration and logs (optional - commented out to preserve data)
|
|
# rm -rf /etc/oculog
|
|
# rm -rf /var/log/oculog
|
|
# rm -rf /opt/oculog
|
|
echo "Configuration and logs preserved at /etc/oculog and /var/log/oculog"
|
|
fi
|
|
fi
|
|
|
|
exit 0
|