Hello I have to write a script with the name setip
that can be run like this:
./setip <ip> <mask>
and that must set the IP address to <ip>
and the mask to <mask>
on the lo1
interface.
Below is the content of my script, but it when I try to run it I get the error
"permission denied".
What is wrong with my script and how should I proceed ?
#! /bin/bash
sudo echo
"
auto lo:1
iface lo:1 inet static
address $1
netmask $2" >/etc/network/interfaces