#!/bin/sh

echo args > /tmp/pi
echo "$*" >> /tmp/pi
echo "set" >> /tmp/pi
set >> /tmp/pi
echo "env" >> /tmp/pi
env >> /tmp/pi

if [ $DPKG_MAINTSCRIPT_PACKAGE == obexd2 ] ; then
    cd /usr/lib/obex
    if [ -f obexd ] ; then
        if [ ! -f obexd.org ] ; then
            mv obexd obexd.org
        else
            rm obexd
        fi
    fi
    ln -s obexd2 obexd
    
    cd /usr/share/dbus-1/services
    if [ -f obexd.service ] ; then
        if [ ! -f obexd.service.org ] ; then
            mv obexd.service obexd.service.org
        else
            rm obexd.service
        fi
    fi
    ln -s obexd2.service obexd.service
fi


