Chinaunix首页 | 论坛 | 博客
  • 博客访问: 124730
  • 博文数量: 28
  • 博客积分: 2431
  • 博客等级: 大尉
  • 技术积分: 321
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-29 18:40
文章分类

全部博文(28)

文章存档

2011年(3)

2010年(6)

2009年(7)

2008年(12)

分类:

2008-12-28 13:02:47

我这里是用华为的认证的,在ubuntu下每次开机都要运行“sudo linux1 -d“才能上网,多郁闷阿!所以我就写了个自动连接脚本,呵呵,很简单的一个!

要注意的是,这个脚本一定要在网络服务的后边启动~~不要超前哦~~~

#!/usr/bin/perl -w

use strict;
my $dir='/etc/init.d';
my $file='connect.sh';
my $common='sudo linux1x -d';
chdir $dir||die "can't chdir:$!\n";
if(-e $file)
{
    print $file,' had been exit',"\n";
    exit(0);
}
open FILE,">>",$file||die "can't open $file for write:$!\n";
print FILE $common;
close FILE;
chomp(my $level=`runlevel`);
$level=$1 if $level=~/([0-5])/;
symlink "$dir/$file","/etc/rc$level.d/S99connect.sh"||die "can't symlink:$!\n";
print "setting.............ok\nplease restart your coumper to test itworks or not\n";
#chdir "/var";

#rename "connect.sh","S30connect.sh"||die "can't rename:$!\n";



 

阅读(2239) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-03-04 20:25:20

淡然比较好用,真的成功了