修复 crontab 安装检测失效的问题

This commit is contained in:
LamGC 2023-01-28 20:01:11 +08:00
parent 73a2fba224
commit ee47565095
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -163,7 +163,7 @@ update_sshkeys
# 检查是否指定了 --cron # 检查是否指定了 --cron
if [ $(has_param "-c" "--cron") == "true" ]; then if [ $(has_param "-c" "--cron") == "true" ]; then
# 检查 Crontab 是否已安装 # 检查 Crontab 是否已安装
if [ $(command -v crontab) == "" ]; then if [ "$(command -v crontab)" == "" ]; then
if [ $(id -u) -eq 0 ]; then if [ $(id -u) -eq 0 ]; then
echo "The crontab is not installed, and the script is executed as a root user, so it will be installed." echo "The crontab is not installed, and the script is executed as a root user, so it will be installed."
if [ -f /etc/redhat-release ]; then if [ -f /etc/redhat-release ]; then