#!/bin/bash

set -e
package=oem-fix-misc-cnl-1886894
path=/etc/grub.d
rm_path=/usr/share/grub/grub-1886894
configs=("10_linux")

if [ remove == "$1" ] || [ abort-install == "$1" ] || [ disappear == "$1" ]; then
	for config in "${configs[@]}"
  do
  	dpkg-divert --package "$package" --rename --remove "$path"/"$config"
	done

  if [ -d "rm_path" ]; then
    rmdir "$rm_path"
  fi
  update-grub
fi


