Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【一些看法】windows使用WSL运行脚本且输出日志 #4

Open
franocisgar opened this issue Dec 1, 2022 · 0 comments
Open

Comments

@franocisgar
Copy link

franocisgar commented Dec 1, 2022

修改FNplus中的中文字符为英文(由于bat变量有中文和空格时会有奇奇怪怪的问题,所以直接全部翻译FNplus.py中的中文),且另存为FNplusEN.py

Freenom 续期消息版 → FreedomRenewalMessage
加载通知服务失败 → FailedToLoadNotificationService
Freenom 续期 → FreenomRenewal
{domain} 续期成功 → {domain}RenewalSucceeded
{domain} 续期失败 → {domain}RenewalFailed
{domain} 还有 {days} 天续期 → {domain}Have{days}DaysToRenew
你没有添加任何账户 → YouHaven'tAddedAnyAccounts
账户与密码不匹配 → AccountAndPasswordDoNotMatch

添加bat进行定时任务
bat内容如下。

@echo off
mode con cols=60 lines=20
title FreenomGetFree
:loop
echo [%date:~,-3% %time:~,-3%]Start detection.
echo [%date:~,-3% %time:~,-3%]Start detection. >> Log.log
for /F %%i in ('wsl python3 FNplusEN.py -u USERNAME -p PASSWORD') do ( set commitid=%%i)
echo %commitid%
echo %commitid% >> Log.log
for /F %%i in ('wsl python3 FNplusEN.py -u USERNAME -p PASSWORD') do ( set commitid=%%i)
echo %commitid%
echo %commitid% >> Log.log
echo [%date:~,-3% %time:~,-3%]After the detection is completed, wait for a day to start the next round of detection.
echo [%date:~,-3% %time:~,-3%]After the detection is completed, wait for a day to start the next round of detection. >> Log.log
timeout /t 86400 >nul
goto loop

bat创建快捷方式,添加开机自启即可。
我目前是使用这种方法的,不知道作者及各位有什么高见?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant