#!/bin/bash . incl_var echo "--WARNING: This script will clear environment variables on older Speedports without EVA Bootloader!!--" echo "If this is the case you need to add some individual variables into this script at the marked position." echo "Make sure only one netcard is installed in your PC, or set an interface via Speed-to-fritz menu.------" echo "You must run ./install-start first, to set up OEM, IPADRESS and LAN! ---------------------------------" echo "Or you may edit in ./incl_var the following three variables:" echo 'export OEM="avm"' echo 'export ETH_IF="eth0"' echo 'export IPADDRESS="192.168.178.1"' echo "------------------------------------------------------------------------------------------------------" echo "--------------------------------------- ${IPADDRESS} ------------------------------------------------" echo "--------------------------------------- BRANDIG: $OEM ------------------------------------------------" CNET=${IPADDRESS%.*} NET=${CNET%.*} ETHLIST=" eth0 eth1 eth2 eth3" if [ $ETH_IF ]; then ETHLIST="$ETH_IF" echo "Net cards set up for search active netconnections: $ETHLIST" echo "This was set via command line parameter of sp-to-fritz.sh." else echo "Net cards set up for search active netconnections: $ETHLIST" echo "This list was set default, but can be set in advance." fi for ETH in ${ETHLIST} ; do if ifconfig $ETH > /dev/null ; then echo "Ethernet card found on: $ETH" break fi done ifconfig $ETH add ${CNET}.10 &> /dev/null ifconfig $ETH | grep 'inet addr' | sed -e "s/inet addr/PC Netcardaddr: /g" PTEST=" finalize=1 subnet=2.10" touch empty for i in ${PTEST} ; do case $i in subnet=*) PTEST_SERVER=${NET}.${i##subnet=} export PTEST_SERVER echo "PTEST_SERVER=$PTEST_SERVER" esac done echo "You should now reboot your box. Waiting for box to shut down for restart ..." while [ `ping -c1 -w1 ${IPADDRESS} | grep 'receive' | awk '{ print $4 }'` == "1" ]; do echo -n "." sleep 1 done while [ `ping -c1 -w1 ${IPADDRESS} 2>&1 | grep -c 'Unreachable'` != "0" ] ||\ [ `ping -c1 -w1 ${IPADDRESS} | grep 'receive' | awk '{ print $4 }'` == "0" ]; do echo -n "." done echo "." echo "Reset Environment..." ftp -n -p <