24 lines
703 B
Bash
Executable File
24 lines
703 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ "${EUID}" -ne 0 ]]; then
|
|
echo "Please run as root: sudo ./uninstall.sh" >&2
|
|
exit 1
|
|
fi
|
|
|
|
INSTALL_DIR="${INSTALL_DIR:-/opt/vehicle-video-service}"
|
|
|
|
systemctl disable --now vehicle-video-service.service vehicle-video-srs-record.service vehicle-video-srs-live.service \
|
|
>/dev/null 2>&1 || true
|
|
|
|
rm -f /etc/systemd/system/vehicle-video-service.service
|
|
rm -f /etc/systemd/system/vehicle-video-srs-record.service
|
|
rm -f /etc/systemd/system/vehicle-video-srs-live.service
|
|
systemctl daemon-reload
|
|
|
|
if [[ "${REMOVE_DATA:-0}" == "1" ]]; then
|
|
rm -rf "$INSTALL_DIR"
|
|
else
|
|
echo "Kept installed files at $INSTALL_DIR. Set REMOVE_DATA=1 to remove them."
|
|
fi
|