Any good ideas on Kibana service at Linux machine

I think sometimes we install a new plugin and then I want to restart the Kibana server and elasticsearch service, I am wondering any ideas to create a .sh file to make it happen? Thank you !!

The normal way to restart either service would be to use the init script or whatever your Linux distribution uses. In some cases there's a service program that you'd use.

That said, to restart a node in an Elasticsearch cluster one would usually want to disable allocations while the node is being restarted, so in that area there's certainly room for some automation.