#!/bin/bash # Post-removal script for Zhinian Assistant on Linux set -e # Remove symbolic links rm -f /usr/local/bin/zhinian-assistant 2>/dev/null || true # Only remove the app-managed OpenClaw CLI wrapper. If the user had OpenClaw # installed separately, leave their command and ~/.openclaw data untouched. OPENCLAW_WRAPPER="/opt/智念助手/resources/cli/openclaw" if [ "$(readlink /usr/local/bin/openclaw 2>/dev/null || true)" = "$OPENCLAW_WRAPPER" ]; then rm -f /usr/local/bin/openclaw 2>/dev/null || true fi # Update desktop database if command -v update-desktop-database &> /dev/null; then update-desktop-database -q /usr/share/applications || true fi # Update icon cache if command -v gtk-update-icon-cache &> /dev/null; then gtk-update-icon-cache -q /usr/share/icons/hicolor || true fi # Remove AppArmor profile APPARMOR_PROFILE_TARGET='/etc/apparmor.d/zhinian-assistant' if [ -f "$APPARMOR_PROFILE_TARGET" ]; then rm -f "$APPARMOR_PROFILE_TARGET" fi echo "Zhinian Assistant has been removed."