切换ip的3个脚本

2014-11-23 21:40:06 · 作者: · 浏览: 22

第一个文件storeip.sh,用来保存记录的



#!/bin/sh


printf "Enter the Name :"


read iplocal


printf "Enter the IP:"


read ip


printf "Enter the netmask:"


read mask


printf "Enter the gateway:"


read gate


if [ ! -f ipdata ] ; then


touch ipdata


fi


num=`wc -l ipdata | awk ' { printf "%s", $1=$1+1 } '`


printf "$num\t$iplocal\t\t$ip\t$mask\t$gate\n" >;>; ipdata