源脚本来自 http://forums.dropbox.com/topic.php?id=12153, 但是不能支持代理服务器, 主要问题是它的”联网检测”用的是ping, Felix将其改成了wget然后判断页面上是否有forums
Patch 如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
--- a/dbupdate +++ b/dbupdate @@ -37,7 +37,7 @@ declare -r useCount="http://bit.ly/dbupdate_count"; declare -r nIcon="/usr/share/icons/hicolor/64x64/apps/dropbox.png"; declare -r userAgent="Mozilla/5.0 (X11; U; Linux i686; $LANG; rv:1.9.1.3) Gecko/20090924 Ubuntu/9.10 (karmic) Firefox/3.5.3"; -declare -r internetTest="ping -c3 -w10 www.dropbox.com | grep -c '64 bytes'" ; +declare -r internetTest="wget -qO - http://www.dropbox.com | grep -c 'forums'" ; bit="auto"; testing=0; q="-q"; @@ -292,7 +292,7 @@ #test connectivity printf "Checking for connectivity to Dropbox servers..."; -if [ `eval $internetTest` -lt 3 ]; then { +if [ `eval $internetTest` -lt 1 ]; then { echo " FAIL."; echo "Failed to connect to \"www.dropbox.com\""; exit 1; |