Skip to content

armgit / kiri

Public Imported from GitHub
0

A small, fast container runtime for macOS, Windows and Linux

Rust
903 B
Raw Blame
#!/bin/sh
# kiri / kiri-lite .deb: before the files go. Stops the engine (containers it
# ran stop with it) and withdraws Kiri's docker CLI from PATH.
set -e
# Removing Kiri stops everything it runs: the engine (above, which stops its
# containers), and any window or kiri command still open from this package
# (`kiri share`, `kiri ui`), first asked to quit, then made to.
stop_everything() {
  for sig in TERM KILL; do
    pkill -"$sig" -f '^/usr/lib/kiri/kiri-window( |$)' 2>/dev/null || true
    pkill -"$sig" -f '^(/usr)?/bin/kiri( |$)' 2>/dev/null || true
    [ "$sig" = KILL ] || sleep 1
  done
}
case "$1" in
  remove|deconfigure)
    if [ -d /run/systemd/system ]; then
      systemctl disable --now kiri.service || true
    fi
    stop_everything
    if [ -x /usr/libexec/kiri/docker ]; then
      update-alternatives --remove docker /usr/libexec/kiri/docker || true
    fi
    ;;
esac
exit 0