fix: 修复潜在的 Shell 符号解析问题.

当 Cron 表达式包含 `*` 时, 可能会被解析成文件列表, 因此修复这个问题.
This commit is contained in:
LamGC 2023-11-06 06:10:18 +00:00 committed by GitHub
parent a72e60d80a
commit b01cb6ff36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')"