#!/bin/sh
. $MIGTEST/lib/migration/migration.sh
. /lib/functions.sh

wireless_change_chiper() {
       local cfg="$1"
       config_get encryption "$cfg" encryption
       [ "$encryption" = "psk-mixed" ] && uci_set wireless "$cfg" encryption "psk-mixed+tkip+ccmp"
}

$LOG_TOOL "upgrade from v2.1.0 to v2.2.2"
config_load wireless
config_foreach wireless_change_chiper wifi-iface

[ "$($UCI_TOOL changes wireless | wc -l)" = "0" ] || $UCI_TOOL commit wireless
exit 0