Hello,
You could either write your own plugin, or you could use one of the plugins in the Marketplace.
For example, you could use the Power Actions add-on:
This plugin will let you to add a button and then you can execute a bash script with this method:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.