How to get notified of new LTS kernel (or auto-update to latest LTS kernel)?

@papajoke @thingsiplay I was wondering if you guys still use this script:

I tried it but it does not return anything. I tried command by command but already had trouble not getting an output from the first command.
I would like to get it working and then slightly modify it, as all I need is a warning about a newer LTS kernel, regardless of the status of the currently installed kernel.