Running a local script using slash command

Hi all,

I am running a self hosted mattermost in docker without using nginx as described in Install Mattermost via Docker — Mattermost documentation

Now I want to setup a custom slash command to be able to run a bash script located within the mounted volume of the mattermost container and display the output of the script back on the channel. I am unable to figure out how to integrate the slash command with my script using the Request URL and Request Method options on the slash command integration. Could someone please help?

Hi @Deepak and welcome to the Mattermost forums!

You cannot run bash scripts directly, you would have to run a web server on your local machine that accepts the HTTP calls for the slash commands from the Mattermost server and then in turn executes the bashscripts for you. The interface to be used here is HTTP, so what you’re looking for is a small wrapper for incoming HTTP calls to running bash scripts or you can set up any webserver (like Apache) and configure the CGI mechanism there to run your local bash scripts.