#!/bin/sh
[ -n "${IPKG_INSTROOT:-}" ] || /etc/init.d/codex stop >/dev/null 2>&1 || true
root="${IPKG_INSTROOT:-}"
for directory in /usr/share/linkease/apps.d /usr/share/linkeasefull/desktop-apps.d; do
	registration="${root}${directory}/35-codex.json"
	if [ "$(readlink "${registration}" 2>/dev/null)" = "/usr/share/codex/codex-plugin.json" ]; then
		rm -f "${registration}"
	fi
done
rmdir "${root}/usr/share/linkeasefull/desktop-apps.d" 2>/dev/null || true
exit 0
