I'd like to be able to make changes to my configuration in an automated way via an SSH connection. I have a file with the following content:
/ip firewall mangle
add chain=whatever blah blah
add chain=whatever blah blah
If I type something like this at the command line it works fine. If I connect via SSH and do the same thing it works fine. But if I try and automate this process by piping it to an SSH session:
$ cat foobar.txt | ssh -i admin 192.168.88.1
Then I get the error message
bad command name add (line 1 column 1)
If I change my file to be
/ip firewall mangle add chain=whatever blah blah
/ip firewall mangle add chain=whatever blah blah
then it works, but this means modifying my script to have a lot of repeated information in it. Am I doing something obviously wrong here?