I’m completely new to Mikrotik scripting so forgive me if this is a simple question. I’m trying to turn on and off my ethernet connection depending on a true/false from a shell script I’ve got. Effectively, I want to trigger a Mikrotik script from a shell script. Is this possible? Some example code would be greatly appreciated!
Yup those seem to be reasonable ways of calling shell scripts from MikroTik scripts (I’m assuming since they start with /interface or /system) but I’m actually looking to call a MikroTik script from a shell script. I’ll provide a simple example below
#!/bin.sh
filename=`basename "$0"`
for pid in $(pidof -x $filename); do
if [ $pid != $$ ]; then
echo "Process is already running with PID $pid"
# Call MikroTik script here to open connection
# Do something with open connection
# Call MikroTik script here to close connection
fi
done
Sorry for asking a vague question earlier and thanks for your time!