From b01cb6ff36e4abf972adb183b8ba706f380bfa58 Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 6 Nov 2023 06:10:18 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=20Shell=20=E7=AC=A6=E5=8F=B7=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当 Cron 表达式包含 `*` 时, 可能会被解析成文件列表, 因此修复这个问题. --- conf-sshd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf-sshd.sh b/conf-sshd.sh index 9935835..b9f274a 100755 --- a/conf-sshd.sh +++ b/conf-sshd.sh @@ -197,7 +197,7 @@ if [ $(has_param "-c" "--cron") == "true" ]; then echo "Install conf-sshd script successfully." # 将当前脚本追加到当前用户的 Crontab 中 crontab -l > ~/.conf-sshd/crontab.old - echo "$cron \"/bin/bash ~/.conf-sshd/conf-sshd.sh -o\" >> ~/.conf-sshd/run.log" >> ~/.conf-sshd/crontab.old + echo '$cron "/bin/bash ~/.conf-sshd/conf-sshd.sh -o" >> ~/.conf-sshd/run.log' >> ~/.conf-sshd/crontab.old crontab ~/.conf-sshd/crontab.old rm ~/.conf-sshd/crontab.old echo "Crontab has been configured.(Cron: '$cron')"