#!/bin/sh
if [ "${PPP_IFACE}" == "PPTP_TUNNEL_1" ] || [ "${PPP_IFACE}" == "PPTP_TUNNEL_2" ] || [ "${PPP_IFACE}" == "PPTP_TUNNEL_3" ]; then
    #PPTP CLIENT
    logger -p user.debug "[PPTP CLIENT UP].interface ${PPP_IFACE} remote_ip ${PPP_REMOTE} local_ip ${PPP_LOCAL}"
    rmsg pptp action connected interface ${PPP_IFACE} remote_ip ${PPP_REMOTE}  local_ip ${PPP_LOCAL} tunnel_name ${PPP_IFACE}
else
    #PPTP SERVER
    if [ "${PPP_IPPARAM}" != "ROS_XL2TPD_SERVER" ] && [ "${PPP_IPPARAM}" != "" ] && [ "${PPP_SPEED}" == "115200" ]; then
        if [ "${PPP_IFACE}" != "L2TP_TUNNEL_1" ] && [ "${PPP_IFACE}" != "L2TP_TUNNEL_2" ] && [ "${PPP_IFACE}" != "L2TP_TUNNEL_3" ]; then
            logger -p user.debug "[PPTP SERVER UP].interface ${PPP_IFACE} remote_ip ${PPP_REMOTE} local_ip ${PPP_LOCAL}"
            rmsg pptp action connected interface ${PPP_IFACE} remote_ip ${PPP_REMOTE}  local_ip ${PPP_LOCAL} tunnel_name pptpd
        fi
    fi
fi
