#!/bin/bash . $include_modpatch echo "-- adding GUI switch to set reg_from_outside" DIRI="$(find ${1}/usr/www/ \( -name fon_config_End.frm -o -name fon_config.frm -o -name fon_config_IPPhone_1* -o -name fon1IPPhone* \) -type f -print)" for file_n in $DIRI; do grep -q "id=.uiPostIPPhoneExtRegFromOutside. disabled" "$file_n" || sed -i '/id="uiPostIPPhoneExtNumber"/ a' "$file_n" grep -q "CopyValue. .uiPostIPPhoneExtRegFromOutside., .uiIPPhoneExtRegFromOutside" "$file_n" || sed -i '/jslEnable("uiPostIPPhoneExtNumber")/ ajslCopyValue( "uiPostIPPhoneExtRegFromOutside", "uiIPPhoneExtRegFromOutside"); jslEnable("uiPostIPPhoneExtRegFromOutside");' "$file_n" grep -q "var:IPPhoneExtRegFromOutside" "$file_n" || sed -i '/id="uiShowOutgoingMsn"/ i if eq "$var:TechType" "IPPHONE" ` \n