#!/bin/bash

version_check(){
    if [ "$(uname -r)" == "VERSION" ];then
        echo "WARNING"
        echo ""
        echo "You are trying to remove the kernel currently running"
        echo "This is a bad idea, please boot from a different"
        echo "kernel version first and make sure it is set as always"
        echo "booting (NOT TESTING)"
        echo ""
        echo "If you wish to continue, please type \"I want to break my system\""

        read reply

        if [ "$reply" != "I want to break my system" ];then
            exit 1
        fi
    fi
}

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
    # we shouldn't let people remove the currently running kernel
    version_check
fi
