Report abuse

#!/bin/bash
#
# $Id: //depot/ops/corp/puppet/common/modules/network/files/mac/wireless/ppp/ip-up#2 $
#
# Checks for presence of Huawei or Novatel WWAN drivers, and if present,
# removes spurious route provided by ISPs to machines with these drivers.

PATH=/bin:/usr/bin:/usr/sbin

WWAN_PRESENT=$(kextstat -l 2> /dev/null | egrep -c 'com.Huawei.driver.HuaweiDataCardDriver|com.novatelwireless.driver.3GControl')

if [[ ${WWAN_PRESENT} -eq 1 ]]; then
  # Found a loaded Huawei or Novatel kext, so remove net 10 route.
  /sbin/route delete -net 10
fi

# If you need to set up any customizations in ip-up, please put them in
# /etc/ppp/ip-up-custom and make it executable.
if [[ -x /etc/ppp/ip-up-custom ]]; then
  . /etc/ppp/ip-up-custom
fi

exit 0