#!/bin/bash usage() { cat << EOF Shell script to make your Speedport functioning like a Fritz!Box Usage: ./sp-to-fritz.sh [OPTIONS] -m MODEL To run properly the scripts needs superuser privileges. Login as 'root' or use 'sudo ./sp-to-fritz ...' instead. This script uses binarys in suibdirectory /tools, if you use this on other LINUX systems as on x86 machines (Intel etc.) compile the tools for your hardware in use. Source of the tools: http://trace.freetz.org/browser/trunk/tools It is known that the skript can cause problems on some systems. Tested systems are andLinux, Stinkylinux, Debian, SuSe, Knoppix, Ubuntu. On some systems you have to add the patch tool ( [sudo] apt-get install patch). eample: ./sp-to-fritz.sh -f -p -o avm -m 701 OPTIONS: -z Don't use commandline otions at all, use configfile or menu instead. ./start.sh starts menuconfig and speed-to-fretz. -x ANNEX Sets the annex of the box to the value specified in 'ANNEX'. Defaults to 'B'. ATENTION! Sets annex only to the specified value, if push option form the skript or Web GUI update funktion is used! (All configurations set in CONFIG sections of rc.conf or rc.init are disabeled). ANNEX="A" -f Apply patch for reverse lookup of caller id @ 'dasoertliche.de'. Only in use with some Options. -h HOSTNAME Sets the hostname of the box to the value specified in 'HOSTNAME'. Defaults to 'fritz.box'. -q quiet mode. Suppresses excessive output while processing files. -t Create 'tar'ed firmware image file for install via WEB UI; If not specified 'kernel.image' file is created for ftp upload. -o OEM Set branding of the box to the value of 'OEM'. 'OEM' may be chosen from 'avm', 'avme', '1und1','aol','freenet', or 'tcom'. If no brand is specified, 'avm' is set as the default. Not every branding is supported, depends on the firmware in use. tcom branding uses the values of the original Box, all other brandings use the settings from the AVM Image. This parameter is only in use with the -t and -p option. The resulting kernel.image is NOT effected by this option. The kernel.image has all possible settings built in. -u flash original firmware via FTP used in combination with option -p -p push kernel.image to flash via FTP -i INTERFACE can be eth0 ... eth9 -c CONFIGURATIONFILENAME Sets the variable firmwareconf_file_name to the value specified in 'CONFIGURATIONFILENAME'. Defaults to 'firmware.conf{MODEL}'. If 'CONFIGURATIONFILENAME' is set to '.config' then all other options are out of function, because they are set via menuconfig. Required Arguments: -m MODEL where 'MODEL' must be one of the following: '500' for T-Sinus W 500V '501' for Speedport W 501V '503' for Speedport W 503V '701' for Speedport W 701V (avm image is used for W701) '721' for Speedport W 721V '900' for Speedport W 900V (avm image is used for W900) '920' for Speedport W 920V OR easy call via single name without parameters. Read info.txt as well! EOF } ######################################################################### if [ `id -u` -ne 0 ]; then echo "ATTENTION! You must run this skrit as root or wraped with fakeroot!" sleep 10 exit 1 fi if [ $# -lt 1 ]; then usage exit 1 fi ######################################################################### while getopts ":ztfurqp:i:h:x:o:m:c:" parm; do case "$parm" in z) export DONT_USE_COMLIINEOPTIONS="y";; i) export ETH_IF="$OPTARG";; h) export HOSTNAME="$OPTARG";; x) export ANNEX="$OPTARG";; t) export TARIMG="y";; f) export DO_LOOKUP_PATCH="y";; p) export TARIMG="n" export PUSHCONF="y" if [ -n "$OPTARG" ]; then if [ "${OPTARG:0:1}" = "-" ]; then let OPTIND=$OPTIND-1 fi fi;; u) export ORI="y" export PUSHCONF="y";; q) export VERBOSE="";; m) export SPMOD="$OPTARG" [ "$firmwareconf_file_name" = "Firmware.conf" ] && export firmwareconf_file_name="firmware.conf$OPTARG";; c) export firmwareconf_file_name="$OPTARG";; o) export OEM="$OPTARG";; :) if [ "$OPTARG" = "p" ]; then export TARIMG="n" export PUSHCONF="y" else usage exit 1 fi;; *) usage echo "Option not supported!" sleep 20 exit 1;; esac done