user script添加如下脚本:
#!/bin/bash
# 定义每周六的关机时间
shutdown_time="23:00"# 检查当前星期几
day_of_week=$(date +%u)# 如果是星期六(值为6),则执行关机命令
if [ $day_of_week -eq 6 ]; then
shutdown -h $shutdown_time
fi
user script添加如下脚本:
#!/bin/bash
# 定义每周六的关机时间
shutdown_time="23:00"# 检查当前星期几
day_of_week=$(date +%u)# 如果是星期六(值为6),则执行关机命令
if [ $day_of_week -eq 6 ]; then
shutdown -h $shutdown_time
fi
君相见
这个人很懒,什么都没留下
文章评论