In the code below how do I get sed's find and replace value to cary over into the output that gets redirected to the .txt file at the end? Everything else gets replaced but everything in the if statement gets left behind.
# example: ./configure input-file, SSID, IP, device-name, gateway, frequency
#
#
FILE=${1}
SSID=${2}
IP=${3}
DEVICE=${4}
GATEWAY=${5}
if [[ ${#} == 5 ]]; then # {
FREQUENCY=${6}
sed -e "s/\(empty-frequency\)/${FREQUENCY}/g"
fi
sed -e "s/\(empty-ssid\).*/${SSID}/g" \
-e "s/192\.168\.1\.20$/${IP}/g" \
-e "s/\(NanoBridge M.\)/${DEVICE}/g" \
-e "s/\(192\.168\.1\.1\).*/${GATEWAY}/g" ${FILE} > /home/garrett/Desktop/NEW-CONFIG.txt
#END#