The trivial script does this.
You have to make changes to the stock version that the script uses...