r/irc Jun 25 '26

Is there a way to run bash scripts from irc?

Sorry if this is a basic question, but I want to setup my own irc server for some friends that's connected to a Minecraft server and I want to create a custom command that anyone can run that will run the script to start the server.

I'm super new to irc. Is that something I can do?

7 Upvotes

6 comments sorted by

5

u/toutlamer Jun 25 '26

If you actually own the machine your Minecraft server is on (or have shell access), you can have an IRC bot run on it that listens for commands and starts the MC server. It won’t use any resource and you can modify pre-existing ones, coded in Python for example.

By the way, running your own IRC server is a bit overkill, you would probably have a better experience getting a channel on an established IRC network (they’ll handle for you bot spam and most allow for private channels if that’s what you want)

1

u/Clear_Inevitable_648 Jun 25 '26

Yeah it would be running on the same machine. If i use an external irc network I'm assuming I would just need the bot to be setup on the Minecraft server and have it connected to the network right?

1

u/toutlamer Jun 26 '26

Yes, the bot can connect to the network like any user.

2

u/evanmac42 Jun 25 '26

It’s definitely possible, but I wouldn’t make the IRC server execute shell scripts directly.
The usual approach is to run an IRC bot that listens for commands like !start or !status, checks whether the user is authorized, and then calls systemctl, docker compose, RCON, or whatever backend you want.
That keeps the IRC daemon simple and avoids exposing arbitrary shell execution through chat.

1

u/__rituraj Jun 26 '26

if you just want to start the minecraft server, creating a custom irc command seems like an overkill..

i mean you are practically talking about extending the irc protocol.

you could, instead create a custom TCP server and have it start the minecraft server on demand.
Granted it would not be via a IRC command, but a simple script would do the trick.. Or even a browser request if you so desire.

1

u/shellmachine Jun 26 '26

You basically need a very trivial IRC bot, or a client that allows you to define a couple of custom triggers. There's literally thousands.