日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

ustc linux 网络通,USTC 网络通脚本

發布時間:2023/12/15 linux 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ustc linux 网络通,USTC 网络通脚本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

#!/usr/bin/perl

$wget="/usr/bin/wget";

$name="xxxx";

$password="xxxx";

$url="http://wlt.ustc.edu.cn/cgi-bin/ip";

$log="/dev/null";

$page="/tmp/wlt_state";

$cookies="/tmp/wlt_cookies";

@type=( "教育網出口(國內)",

"電信網出口(國際,到教育網走教育網,缺省)",

"網通網出口(國際,到教育網走教育網)",

"電信網出口2(國際,到教育網免費地址走教育網)",

"網通網出口2(國際,到教育網免費地址走教育網)",

"電信網出口3(國際,文獻出口)",

"網通網出口3(國際,到教育網走教育網,到電信走電信)");

@[exp](http://perldoc.perl.org/functions/exp.html)= ( 0, 120, 3600, 14400, 39600, 50400);

@expstr=("永久", "動態", "1小時", "4小時, 缺省", "11小時", "14小時");

# 登錄網絡通,用--keep-session-cookies和--save-cookies得到Cookies

$cmd="cmd=login";

# 這個輸出頁面不需要,只需要得到cookies

$options="-o$log-O$log--keep-session-cookies --save-cookies$cookies--post-data\"$cmd&name=$name&password=$password\"";

$command="$wget$options$url";

[system](http://perldoc.perl.org/functions/system.html) $command;

[print](http://perldoc.perl.org/functions/print.html) "請選擇出口:\n";

$i=0;

foreach (@type) {

[print](http://perldoc.perl.org/functions/print.html) "\t", $i+1, ":$type[$i]\n";

$i=$i+1;

}

[print](http://perldoc.perl.org/functions/print.html) "注:選擇出口2、3無法使用的某些電子資源,使用出口4、5、6可能可以正常使用\n";

[print](http://perldoc.perl.org/functions/print.html) "[1-7]";

$type=;

$type=$type-1;

$typestr=$type[$type];

[print](http://perldoc.perl.org/functions/print.html) "使用時限:\n";

$i=0;

foreach (@[exp](http://perldoc.perl.org/functions/exp.html)) {

[print](http://perldoc.perl.org/functions/print.html) "\t", $i+1, ":$exp[$i]s,$expstr[$i]\n";

$i=$i+1;

}

[print](http://perldoc.perl.org/functions/print.html) "[1-6]";

$exp=;

$exp=$exp-1;

$expstr=$expstr[$exp];

$exp=$exp[$exp];

$cmd="cmd=set";

# 利用Cookies選擇出口和時限

$options="-o$log-O$page--load-cookies$cookies--post-data\"$cmd&name=$name&password=$password&type=$type&exp=$exp\"";

$command="$wget$options$url";

#print $command,"\n";

[system](http://perldoc.perl.org/functions/system.html) $command;

# 輸出網絡通使用記錄

#print "\t\t\t$name 的網絡通狀態:\n\t$typestr\t$expstr\n";

[open](http://perldoc.perl.org/functions/open.html) PAGE, $page;

@page=;

[close](http://perldoc.perl.org/functions/close.html) PAGE;

foreach $line ([grep](http://perldoc.perl.org/functions/grep.html)(/^

.*$/, @page)) {

[chomp](http://perldoc.perl.org/functions/chomp.html) $line;

$line=~[s](http://perldoc.perl.org/functions/s.html)!

!!;

$line=~[s](http://perldoc.perl.org/functions/s.html)!

! [!;

$line=~[s](http://perldoc.perl.org/functions/s.html)!

!] !;

$line=~[s](http://perldoc.perl.org/functions/s.html)!

!!;

[print](http://perldoc.perl.org/functions/print.html) $line,"\n";

}

總結

以上是生活随笔為你收集整理的ustc linux 网络通,USTC 网络通脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。