# Warn user to clean out old configuration:
if grep -q "START chromium-widevine-plugin" etc/default/chromium 2>/dev/null ; then
  echo "**"
  echo "** Found old configuration for chromium-widevine-plugin -"
  echo "** in /etc/default/chromium"
  echo "** Please remove the block of text in that file,"
  echo "** enclosed by 'START chromium-widevine-plugin' and 'END chromium-widevine-plugin'"
  echo "** It is no longer needed."
  echo "**"
fi

( cd usr/lib/chromium-ungoogled ; rm -rf libwidevinecdm.so )
( cd usr/lib/chromium-ungoogled ; ln -sf ../chromium/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so libwidevinecdm.so )
( cd usr/lib/chromium-ungoogled ; rm -rf WidevineCdm )
( cd usr/lib/chromium-ungoogled ; ln -sf ../chromium/WidevineCdm WidevineCdm )
( cd usr/lib/chromium ; rm -rf libwidevinecdm.so )
( cd usr/lib/chromium ; ln -sf /usr/lib/chromium/WidevineCdm/_platform_specific/linux_x86/libwidevinecdm.so libwidevinecdm.so )
