#!/bin/sh set -e bluetooth_open(){ config_file="/etc/bluetooth/ukui-bluetooth.conf" if [ -e "$config_file" ]; then echo "$config_file exists" else echo "creating conf..." mkdir -p /etc/bluetooth echo "[conf]" > "$config_file" echo "switch=true" >> "$config_file" fi } case "$1" in configure) bluetooth_open if [ -n "$2" ]; then if dpkg --compare-versions "$2" lt "4.20.0.0-2~"; then for path in /usr/lib/*/ukui-control-center/libukcc-bluetooth.so; do [ -e "$path" ] || continue if [ "$(dpkg-divert --listpackage "$path" 2>/dev/null)" = "ukui-bluetooth" ]; then if dpkg-divert --package ukui-bluetooth \ --no-rename --remove \ --divert "${path}.old" "$path"; then if { [ -e "${path}.old" ] || [ -L "${path}.old" ]; } && \ ! dpkg-query -S "${path}.old" >/dev/null 2>&1; then rm -f -- "${path}.old" fi else echo "warning: failed to remove obsolete diversion for $path" >&2 fi fi done fi fi ;; esac # Automatically added by dh_installsystemd/14.3 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'ukui-bluetooth.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'ukui-bluetooth.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'ukui-bluetooth.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'ukui-bluetooth.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/14.3 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "$DPKG_ROOT" ] && [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'ukui-bluetooth.service' >/dev/null || true fi fi # End automatically added section