#!/bin/bash

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

if [ ! -d "$target_path" ]; then
  mkdir -p $target_path
fi
for config in "${configs[@]}"
do
  dpkg-divert --package $package --add --rename \
    --divert $target_path/$config $source_path/$config
done
