#!/bin/sh

package_old=`echo $1 | sed 's|checkbox|hwtest|'`
config_old="/etc/hwtest.d/$package_old.ini"
config_new="/etc/checkbox.d/$1.ini"

sed -e 's|hwtest|checkbox|g' -e 's|Hardware|System|' < $config_old > $config_new

if [ "$1" = "checkbox" ]; then
    cat <<'EOF' >>$config_new
[checkbox/plugins/boot_prompt]
enable = false

[checkbox/plugins/delay_prompt]
timeout = 0

EOF
fi

rm -f $config_old
rmdir --ignore-fail-on-non-empty `dirname $config_old`
