#!/bin/bash

sx_sdk_ver=`dpkg -l sx-sdk-eth 2> /dev/null | grep sx-sdk-eth | awk '{print $3}' | cut -d'.' -f3-5 | cut -d'-' -f1`

test -L /usr/lib/cumulus/wjh/wjh_types.py && rm /usr/lib/cumulus/wjh/wjh_types.py

if [ -z $sx_sdk_ver ]; then
  ln -s /usr/lib/cumulus/wjh/wjh_types_4.4.1624.py /usr/lib/cumulus/wjh/wjh_types.py
elif [ $sx_sdk_ver == "4.4.0952" ] || [  $sx_sdk_ver == "4.4.1624" ] || [ $sx_sdk_ver == "4.3.3260" ]; then
  ln -s /usr/lib/cumulus/wjh/wjh_types_$sx_sdk_ver.py /usr/lib/cumulus/wjh/wjh_types.py
else
  ln -s /usr/bin/wjh_types.py /usr/lib/cumulus/wjh/wjh_types.py
fi
