Backport cli scanner to stable5

backport of #4285 to stable5

As already stated before within #4285 - this script is necessary for the script based upgrade testing I'm working on.


@icewind1991 @karlitschek @butonic @blizzz @bartv2 - THX