s235784 / NJUPT_AutoLogin

南京邮电大学校园网自动登录脚本(路由器用),内附单线多拨教程
https://nuotian.furry.pro/blog/archives/347
Apache License 2.0
28 stars 2 forks source link

Openwrt多拨的问题 #11

Open KansChen opened 2 days ago

KansChen commented 2 days ago

2024年9月实测openwrt多拨依旧有效,效果为速率提升。 代码更新后,第二个口登录时会检测到有网,直接跳过。

if is_internet_connectable; then
        println_ok "Successfully connected to the Internet."
    else
        if [[ $time_limited_account -eq 0 ]]; then
            println_info "Time limited account. Checking the time..."
            if check_time; then
                println_ok "Time is within the range."
            else
                println_error "Time is out of range."
                exit 1
            fi
        fi

        login_the_wifi
        is_internet_connectable
        if [[ $? -eq 1 ]]; then
            println_error "Failed to connect to the Internet."
        fi
    fi

可以考虑增加一个参数,无视网络直接连接。

s235784 commented 2 days ago

感谢测试。 无视网络状态的参数在之前的版本中是存在的,但是在我本地环境中多播已经失效很久了,遂删除。也许不同苑之间的网络提供设备在用户认证上存在区别,这个需要更多测试来验证。 下一个版本会把无视网络状态参数重新加入。

KansChen commented 2 days ago

本人在桂苑。 经过了一个小时的debug后,这似乎是一个bug。 我间隔数分钟测试多次(使用第二个网口登录第二个号),在第三次成功(检测到没有网络开始登录)。期间两个网口的ip均未发生变化。这个过程是在第一个网口已经登录的情况下,有网测试的。

稍后我同时将两个网口都logout,10分钟之后同时使用脚本登录,未出现此问题。 不确定是否是某种特殊情况下(长时间网口1已登录,网口2未登录)的bug,这种情况在1个账号是有限制的,1个账号是无限制的情况下非常容易触发。这个问题似乎也需要更多的测试来验证。