Files
venus/dbus-anchor-alarm/uninstall.sh
2026-03-26 14:15:02 +00:00

33 lines
740 B
Bash
Executable File

#!/bin/bash
#
# Uninstall script for dbus-anchor-alarm
#
set -e
SERVICE_NAME="dbus-anchor-alarm"
if [ -d "/service" ] && [ ! -L "/service" ]; then
SERVICE_DIR="/service"
elif [ -d "/opt/victronenergy/service" ]; then
SERVICE_DIR="/opt/victronenergy/service"
elif [ -L "/service" ]; then
SERVICE_DIR=$(readlink -f /service)
else
SERVICE_DIR="/opt/victronenergy/service"
fi
echo "Uninstalling $SERVICE_NAME..."
if [ -L "$SERVICE_DIR/$SERVICE_NAME" ]; then
svc -d "$SERVICE_DIR/$SERVICE_NAME" 2>/dev/null || true
sleep 2
rm "$SERVICE_DIR/$SERVICE_NAME"
echo "Service symlink removed"
fi
echo ""
echo "Uninstall complete."
echo "Files remain in /data/$SERVICE_NAME/ -- remove manually if desired."
echo ""