如何在我的树莓派上仅通过ssh访问,在几个小时内禁用Wi-Fi?

huangapple go评论72阅读模式
英文:

How do I rfkill block wi-fi on my raspberry only for a few hours? (Only ssh access)

问题

现在我只能通过Wi-Fi访问我的树莓派Zero W,但我仍然想每天封锁几个小时的Wi-Fi,然后自动解锁,以便我可以再次访问树莓派。

通常,可以使用rfkill来封锁和解锁,但因为当Wi-Fi关闭时我将无法登录,所以我需要一个脚本来在几个小时后自动解锁Wi-Fi。

这可行吗?

英文:

Right now I can only access my raspberry pi zero w via wifi but still I would like to block wifi for a few hours every day and then unblock it automatically so I can access the raspberry again.

Normally, one could just use rfkill to block and unblock but because I will not be able to log in when wi-fi is down, I will need a script to unblock wi-fi automatically after a few hours.

Is this possible?

答案1

得分: 0

使用 cron 作业或 systemd 定时器。

英文:

use a cron-job or a systemd timer.

huangapple
  • 本文由 发表于 2023年1月9日 06:16:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75051645.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定