# 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/lib64/chromium-ungoogled ; rm -rf WidevineCdm )
( cd usr/lib64/chromium-ungoogled ; ln -sf ../chromium/WidevineCdm WidevineCdm )
( cd usr/lib64/chromium-ungoogled ; rm -rf libwidevinecdm.so )
( cd usr/lib64/chromium-ungoogled ; ln -sf ../chromium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so libwidevinecdm.so )
( cd usr/lib64/chromium ; rm -rf libwidevinecdm.so )
( cd usr/lib64/chromium ; ln -sf /usr/lib64/chromium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so libwidevinecdm.so )
