I have some route add
commands to run on Ubuntu. It works when I copy the command and paste it on the terminal. But I've tried to create a bash script which looks something like this
#!/bin/bash
sudo route add -net 'someIp' netmask 255.255.0.0 gw 'anotherIp'
sudo route add -net 'someOtherIp' netmask 255.255.0.0 gw 'anotherIp'
But when I run it. the output is:
SIOCADDRT: Dispositivo inexistente
which can be translated to SIOCADDRT: device does not exist
I've run chmod +x
on the file and tried running the script with sudo but it did not work.
What am I missing?