#!/bin/sh
#

if [ "$1" = "configure" ]; then
    if [ -n "$2" ]; then
	if [ -x "/etc/init.d/osso-ipv6" ]; then
	    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d osso-ipv6 stop
	    else
		/etc/init.d/osso-ipv6 stop
	    fi
	fi

	update-rc.d osso-ipv6 remove >/dev/null
    fi

    # Convert old variable to new one
    IAP_BASE=/system/osso/connectivity/IAP
    IF_NEW=`gconftool-2 -g $IAP_BASE/ipv6_interfaces 2>&1`
    echo $IF_NEW | grep "No value set" > /dev/null 2>&1
    if [ $? -eq 0 ]; then
	IF_OLD=`gconftool-2 -g $IAP_BASE/dhcpv6_interfaces 2>&1`
	echo $IF_OLD | grep "No value set" > /dev/null 2>&1
	if [ $? -ne 0 ]; then
	    gconftool-2 -s -t list --list-type string "$IAP_BASE/ipv6_interfaces" "$IF_OLD"
	    gconftool-2 -u "$IAP_BASE/dhcpv6_interfaces"
	fi
    fi
fi

#DEBHELPER#

