#!/usr/bin/bash

# Ubuntu prerm (no parameters)
# removal only, not running before update, but before install
# stop running daemons

systemctl stop cryptoboned
systemctl stop cryptoboneexternd
systemctl stop cryptobone-fetch.timer

# make bootswitch removable
if [ -f /usr/lib/cryptobone/bootswitch ] ; then
     chattr -i /usr/lib/cryptobone/bootswitch
     rm -f /usr/lib/cryptobone/bootswitch 2> /dev/null
fi

exit 0
