Hi there because Groovy Mister appeared I immediately wanted to try it when I was trying to make it work i've noticed that groovy mister needed a static ip for the ethernet port at first i couln't find useful information , then I finally found a mister forum post viewtopic.php?t=1602 in which someone made a script that user says that you only have to open and fill the script ip with the ip you'd like to use so i did , after doing that and opened that script from the scripts folder everything worked like a charm but i've noticed my mister can no longer connect to the wifi network like before so I wanna know how can I reverse this script in order to make my mister work normally like before and also I wanna know which is the best method to set a static ip to the mister ethernet port and if there's a way to have wifi adapter working and if plugged an ethernet using a static ip that script seems to force me using only ethernet port, thanks in advance the script is this:
network_ip_static_eth0.sh
Code: Select all
#!/bin/sh
set -a
# set ip address, subnet mask, standard gateway, dns server and mac address
SIA_IP=192.168.0.77
SIA_SM=255.255.255.0
SIA_GW=192.168.0.1
SIA_NS=8.8.8.8
SIA_MA=02:03:04:05:06:01
# display ip address, subnet mask, standard gateway, dns server and mac address
echo -----------------------------------------
echo Set static IP address for interface wlan0
echo -----------------------------------------
echo "IP address $SIA_IP"
echo "Subnet mask $SIA_SM"
echo "Std gateway $SIA_GW"
echo "DNS server $SIA_NS"
echo "MAC address $SIA_MA"
echo -----------------------------------------
# check if /etc is writeable
if [ ! -w /etc/network/interfaces ]; then
echo
echo ERROR : File /etc/network/interfaces not writeable, run script via ssh shell
echo
exit
fi
# set eth0 static ip address
cat << EOF > /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address $SIA_IP
netmask $SIA_SM
gateway $SIA_GW
dns-nameservers $SIA_NS
EOF
# set dns server
cat << EOF > /etc/init.d/S99staticip
#!/bin/sh
echo 'nameserver $SIA_NS' > /etc/resolv.conf
EOF
chmod 755 /etc/init.d/S99staticip
# disable dhcp client daemon
if [ -f /etc/init.d/S41dhcpcd ]; then
mv /etc/init.d/S41dhcpcd /etc/init.d/disabled.S41dhcpcd
fi
# set eth0 mac address
if [ -f /media/fat/linux/u-boot.txt ]; then
perl -pi -e 'eof && s!$!\nethaddr=$ENV{SIA_MA}! unless s!(ethaddr=)\S+!${1}$ENV{SIA_MA}!;' /media/fat/linux/u-boot.txt
else
echo "ethaddr=$SIA_MA" > /media/fat/linux/u-boot.txt
fi
# power off message
echo
echo POWER MISTER DEVICE OFF + ON
echo