Add setup ip file
This commit is contained in:
parent
a3053c7870
commit
0439744be7
35
monitor/setup/setip.sh
Normal file
35
monitor/setup/setip.sh
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo 'auto lo
|
||||||
|
iface lo inet interface
|
||||||
|
|
||||||
|
auto eth0' > /etc/network/interfaces
|
||||||
|
echo "Enter the type IPaddress"
|
||||||
|
read type
|
||||||
|
echo "iface eth0 inet $type" >> /etc/network/interfaces
|
||||||
|
if [ "$type" = static ]
|
||||||
|
then
|
||||||
|
echo "Enter the IP: "
|
||||||
|
read ipaddr
|
||||||
|
echo " address $ipaddr" >> /etc/network/interfaces
|
||||||
|
echo "Enter the netmask: "
|
||||||
|
read netmask
|
||||||
|
echo " netmask $netmask" >> /etc/network/interfaces
|
||||||
|
echo "Enter the gateway: "
|
||||||
|
read gateway
|
||||||
|
echo " gateway $gateway" >> /etc/network/interfaces
|
||||||
|
echo "Enter the dns-nameservers: "
|
||||||
|
read dns
|
||||||
|
echo " dns-nameservers $dns" >> /etc/network/interfaces
|
||||||
|
else echo "Setup IP success!!!"
|
||||||
|
fi
|
||||||
|
while true; do
|
||||||
|
read -p "Do you wish to reboot device?(y/n)" yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* ) reboot; break;;
|
||||||
|
[Nn]* ) exit;;
|
||||||
|
* ) echo "Please answer yes or no.";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user