#!/bin/bash /sbin/ifconfig > /tmp/ifconfig cat /tmp/ifconfig |grep ppp0 > /tmp/net NET=`cat /tmp/net` OUT=`cat /tmp/ifconfig |tail -n2 |cut -d "(" -f3|cut -d ")" -f1` if [ -n NET ]; then echo -n "$OUT" fi