#!/bin/sh
#  Copyright (c) 2025 Qualcomm Technologies, Inc.
#  All Rights Reserved.
#  Confidential and Proprietary - Qualcomm Technologies, Inc.

PPP_IPPARAM="$6"
NETMASK="255.255.255.255"
MTU="1492"

# Usage: Generate PPPoE dns string
#$1 - DNS1
#$2 - DNS2
setup_dns() {
	if [ -n "$DNS2" -a "$DNS1" != "$DNS2" ]; then
            echo "export DNSSERVERS=\"$DNS1 $DNS2\""
	else
	    echo "export DNSSERVERS=\"$DNS1\""
	fi
}

setup_waneth() {
	/etc/data/backhaulCommonConfig.sh switch_bh $PPP_IPPARAM 1 "$IFNAME" "$IPLOCAL" "$NETMASK" "$IPREMOTE" "$MTU" "$DNS1" "$DNS2"
}

# Setup default backhaul.
if [ -n "$IPLOCAL" ] ; then
	setup_waneth
fi
