| . /etc/utils.sh |
| |
| iface=$1 |
| |
| start_dhcp() { |
| echo "Starting DHCP on $iface" |
| lock=/var/run/dhclient.${iface}.lock |
| lockfile-create $lock |
| pidfile=/var/run/dhclient.${iface}.pid |
| if runnable glaser; then |
| if [ -e $pidfile ]; then |
| kill $(cat $pidfile) 2>&1 > /dev/null |
| rm -f $pidfile |
| fi |
| /usr/sbin/dhclient $iface -d -pf $pidfile \ |
| -lf /var/run/dhclient.${iface}.lease \ |
| -cf /etc/dhclient.conf 2>&1 | logos dhclient & |
| fi |
| pidfile=/var/run/dhclient-v6.${iface}.pid |
| if [ -e $pidfile ]; then |
| kill $(cat $pidfile) 2>&1 > /dev/null |
| rm -f $pidfile |
| fi |
| /usr/sbin/dhclient $iface -6 \ |
| -d \ |
| -pf $pidfile \ |
| -lf /var/run/dhclient-v6.${iface}.lease \ |
| -cf /etc/dhclient6.conf \ |
| --never-gonna-give-you-up 900 2>&1 | logos dhclient6 & |
| lockfile-remove $lock |
| } |
| |
| ip link set dev $iface up |
| if [ $(cat /etc/config/wanport) = $iface ]; then |
| sleep 1 |
| # For GFLT110 defer running sycl until after the |
| # the data path is initialized in /etc/init.d/S71data |
| # There is some issue with doing it here. |
| # TODO(jnewlin): Check if this if fixed in the latest SDK. |
| if [ $(cat /etc/platform) != "GFLT110" ] \ |
| && ! contains "$(kernopt diag)" "prbs"; then |
| start_sycl & 2>&1 | logos sycl & |
| fi |
| # start dhcp if no management vlan is assigned. |
| if [ "x$(cat /etc/config/mgmtvlan)" = "x" ]; then |
| start_dhcp |
| fi |
| elif [ "man" = "$iface" ]; then |
| start_dhcp |
| fi |
| |