User Tools

Site Tools


shell:iprecord

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell:iprecord [2010/03/29 20:47] – created 121.227.64.85shell:iprecord [2016/05/05 13:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +用来查询本机外网IP
 +  w3m -dump -no-cookie http://www.net.cn/static/customercare/yourIP.asp|grep  -A 2 本地上网|tail -n 1|cut -b1-
  
 +<file BASH iprecord.sh>
 +#########################################################################
 +# Author: pengjianqing@sina.com
 +# Created Time: Mon 10 Aug 2009 09:01:31 PM CST
 +# File Name: iprecord.sh
 +# Description: 
 +#########################################################################
 +#!/bin/bash
 +
 +IP=`w3m -dump -no-cookie http://www.net.cn/static/customercare/yourIP.asp|grep  -A 2 本地上网|tail -n 1|cut -b1-`
 +OUTPUT=/home/pjq/ifconfig.txt
 +echo "************************************************" >>${OUTPUT}
 +date >>${OUTPUT}
 +echo ${IP} >>${OUTPUT}
 +ifconfig|grep inet >>${OUTPUT}
 +cat ${OUTPUT}
 +
 +</file>