#!/bin/bash USRWWW="usr/www/${OEMDIR}/$html/de" #normal condition patching menues for dect if [ -d "$SR1/usr/www/${OEMDIR}" ]; then #build link files used on .56 7150 type dect menu for FILE in "dect0" "fon1dect" "fonlistdect" "foneditdect" "fonsetupdect" ; do for EXT in "frm" "html" "inc" "js" ; do DSTF="$SR1/${USRWWW}/home/${FILE}.${EXT}" rm -f "${DSTF}" touch "${DSTF}" echo2 "-> $FILE.$EXT" echo "" >"${DSTF}" done done PatchfileName="add_7150_dect_en" [ "$avm_Lang" = "en" ] && modpatch "$SR1/${USRWWW}" "$P_DIR/${PatchfileName}.patch" #-------------------------------------------------------------------------------- FN="$SR1/${USRWWW}/home/fondevices.html" sed -i -e "/
/i\ <\/div>" "$FN" sed -i -e '/"DeviceIsdnDefauft"/a\ document.write(TrDevice( "DeviceFonDect$0", $0, "2", "", " ","0", ""));<\/script>\ ` ?>' "$FN" #sed -i -e '/"DeviceABExt$0", $0,/a\ #document.write(TrDeviceEx( "DeviceFonDect$0", $0, "2", "", "","0", ""));<\/script>\ #` ?>' "$FN" sed -i -e 's/ 0 2 / 0 1 /' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_fondevices.html" sed -i -e '/"DeviceIsdnDefauft", 0, "1"/a\ document.write(TrDevice( "DeviceFonDect$0", $0, "2", "", " ","0", ""));<\/script>\ ` ?>' "$FN" sed -i -e 's/ 0 2 / 0 1 /' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_Start.html" sed -i -e '/txtPhoneInfoText+=g_txtISDNTelefon;/a\ txtPhoneInfoText+=", "+g_txtDectHG;' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_Start.js" sed -i -e '/var g_txtISDNTelefon/i\ var g_txtDectHG="Schnurlostelefone (DECT)";' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_fondevices.frm" echo '>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '` ?>' >>"$FN" echo '>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '` ?>' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" FN="$SR1/${USRWWW}/home/fondevices.frm" echo '>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '` ?>' >>"$FN" echo '>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '` ?>' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" echo '' >>"$FN" FN="$SR1/${USRWWW}/help/home.html" sed -i -e "/

B<\/h2>/i\

DECT-Devices<\/a><\/P>" "$FN" sed -i -e "/

E<\/h2>/i\

Dynamic DNS<\/a><\/P>" "$FN" sed -i -e "/

T<\/h2>/i\

DECT<\/a><\/P>" "$FN" sed -i -e "/

V<\/h2>/i\

U-APSD<\/a><\/P>" "$FN" sed -i -e "/WLAN-Netzwerkger/i\

WLAN-Network device<\/a><\/P>" "$FN" sed -i -e "/WLAN-Verschl.sselung/a\

WLAN-Incryiption<\/a><\/P>" "$FN" sed -i -e "/

Z<\/h2>/a\

DSL-settings<\/a><\/P>" "$FN" sed -i -e "/additional programs/a\

Repeater, Incryption<\/a><\/P>" "$FN" FN="$SR1/${USRWWW}/home/fondevices.js" sed -i -e 's|var mCount|//var mCount|' "$FN" sed -i -e '/var g_txt_Device_AB = "Answering machine";/a\ var g_txtDect = "DECT ";' "$FN" sed -i -e '/var g_txt_Type_Mini/a\ var g_txt_Type_Dect = "DECT";' "$FN" sed -i -e '/case "1"/a\ case "2" : strRetCode ="DECT";break;' "$FN" sed -i -e '//i\ function RingToAll( nValue) {\ for ( var i=0;i<5;i++) {\ if ( IsHandsetConfigured( i, nValue) == false) return false;\ }\ return true;\ }\ function IsHandsetConfigured( nPos, wert) {\ var oldHandset = jslGetValue( "uiPostDectHandsets"+nPos).charCodeAt(0) - 48;\ if ( (oldHandset & wert) == wert) return true;\ return false;\ }' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_fondevices.js" sed -i -e 's|var mCount|//var mCount|' "$FN" sed -i -e '/var g_txt_Type_Mini/a\ var g_txt_Type_Dect = "DECT";' "$FN" sed -i -e '/case "1"/a\ case "2" : strRetCode ="DECT";break;' "$FN" sed -i -e '//i\ \ " id="uiPostDectSubscribed$10" disabled>\ \ ` ?>\ ' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_End.js" sed -i -e '/<\/script>/i\ function uiDisplayDectID(index) {\ var str="";\ str += (parseInt(index)+1);\ return str;\ }\ function uiDistributeDectMsns() {\ var varText = "";\ var ar_Reset = new Array(true,true,true,true,true);\ var arInCallNo = varText.split( ";", 10);\ for ( var i=0; i<(arInCallNo.length-1);i+=2) {\ var nNewDectPos = getDectMsnPos(arInCallNo[i], true);\ if ( nNewDectPos != (-1)) {\ var nDectID = parseInt(jslGetValue("uiDectID"));\ if ( uiIsDectMsn( arInCallNo[i]) == true) {\ var nNewSettings = uiNewHandsetSetting(nNewDectPos,nDectID);\ if ( nNewSettings != (-1)) {\ jslSetValue("uiPostDectHandsets"+nNewDectPos, String.fromCharCode((48+nNewSettings)));\ jslEnable( "uiPostDectHandsets"+nNewDectPos);\ }\ } else {\ jslSetValue( "uiPostDectMsn"+nNewDectPos, arInCallNo[i]);\ jslSetValue( "uiPostDectHandsets"+nNewDectPos, String.fromCharCode((48+Math.pow(2, nDectID))));\ jslEnable("uiPostDectMsn"+nNewDectPos);\ jslEnable("uiPostDectHandsets"+nNewDectPos);\ }\ ar_Reset[nNewDectPos] = false;\ }\ }\ for ( var j=0;j<5;j++) {\ if ( ar_Reset[j] == true) {\ var nBitValue = Math.pow(2, parseInt(jslGetValue("uiDectID")));\ if ( IsHandsetConfigured( j, nBitValue)) {\ var oldHandset = jslGetValue( "uiPostDectHandsets"+j).charCodeAt(0) - nBitValue;\ jslSetValue( "uiPostDectHandsets"+j, String.fromCharCode(oldHandset));\ jslEnable("uiPostDectHandsets"+j);\ }\ }\ }\ }\ function uiIsDectMsn( msn) {\ for ( var i=0;i<5;i++) {\ if ( msn == jslGetValue("uiPostDectMsn"+i)) return true;\ }\ return false;\ }\ function getDectMsnPos( wert, orNew) {\ for ( var i=0;i<5;i++) {\ if ( wert == jslGetValue("uiPostDectMsn"+i)) return i;\ }\ if ( orNew == true) {\ for ( var j=0;j<5;j++) {\ if ( jslGetValue("uiPostDectMsn"+j) == "") return j;\ }\ }\ return (-1);\ }\ function IsHandsetConfigured( nPos, wert) {\ var oldHandset = jslGetValue( "uiPostDectHandsets"+nPos).charCodeAt(0) - 48;\ if ( (oldHandset & wert) == wert) return true;\ return false;\ }\ function uiNewHandsetSetting( nPos, dectID) {\ var oldHandset = jslGetValue( "uiPostDectHandsets"+nPos).charCodeAt(0) - 48;\ var newHandset = Math.pow(2, dectID);\ if ( (oldHandset & newHandset) != newHandset) {\ newHandset += oldHandset;\ } else {\ newHandset = (-1);\ }\ return newHandset;\ }' "$FN" sed -i -e '/if ((jslGetValue("uiPostIsdnName"+j) == "") || (jslGetValue( "uiPostIsdnNumber"+j) == "")) {return true;}/a\ }\ for ( var k=1;k<6;k++) {\ if (jslGetValue("uiPostDectSubscribed"+k) == "0") {return true;}\ if (jslGetValue( "uiPostDectName"+k) == "") {return true;}' "$FN" sed -i -e 's/extensionNo = ./extensionNo = 2/' "$FN" FN="$SR1/${USRWWW}/fon_config/fon_config_1.js" sed -i -e '/g_NameList.5. = new String(\"internes Faxger/a\ \ ` ?>' "$FN" sed -i -e "s/FFaxx/'Fax'/" "$FN" sed -i -e "s/AABB/'AB'/" "$FN" sed -i -e 's/:\\x0a `~/: `~/' "$FN" sed -i -e 's/<>\/?";/<>\/and?";/' "$FN" sed -i -e '/var g_txt_Device_AB/a\ var g_txtDect = "DECT ";' "$FN" #-------------------------------------------------------------------------------- fi