Assuming you mean in the computer sense, it’s a device that forwards messages from one network connection to another. e.g. between ethernet connections and/or WiFi in home use, typically, or sometimes other kinds of networks in industry.
Messages on the internet are usually transferred as IP packets (Internet Protocol packets). The router looks at the destination address on each packet that arrives, consults a table (“routing table”) to determine which connection to use to forward the message out on, and then it actually copies the message onto that connection. The basic idea is pretty straightforward, but it can get complicated in real world situations when you have multiple networks, redundant links, etc.











I’d suggest replacing the shell script with a Python script as a first step. If nothing else, it will probably be a hell of a lot easier to read… Your bots ought to be able to do a first pass at that. If it’s actually tripping up on some particular bash/dash-ism like you think, that might even just bypass the issue entirely; if not it should be easier to debug with better readability.