Skip to content

Commit 78dd27e

Browse files
committed
fix: Improve password generation error handling when openssl is not found
1 parent 6afffe6 commit 78dd27e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backup.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ generate_password() {
3030
if command -v openssl >/dev/null 2>&1; then
3131
openssl rand -hex 16
3232
else
33-
date +%s | sha256sum | head -c 32
33+
color red "错误:未找到 openssl 。无法生成安全密码。"
34+
exit 1
3435
fi
3536
}
3637

0 commit comments

Comments
 (0)