From 2aed4f9986c3f18b451368b302638ac8a8e743b5 Mon Sep 17 00:00:00 2001 From: W0lfD Date: Wed, 15 Apr 2026 18:45:23 +0300 Subject: [PATCH 1/2] ensure crontab for acme --- pasarguard.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pasarguard.sh b/pasarguard.sh index 0d6664f..4fb71e8 100755 --- a/pasarguard.sh +++ b/pasarguard.sh @@ -321,9 +321,25 @@ is_port_in_use() { return 1 } +get_cron_package_name() { + if [[ "$OS" == "Ubuntu"* ]] || [[ "$OS" == "Debian"* ]]; then + echo "cron" + elif [[ "$OS" == "CentOS"* ]] || [[ "$OS" == "AlmaLinux"* ]] || [ "$OS" == "Fedora"* ] || [ "$OS" == "Arch Linux" ]; then + echo "cronie" + else + return 1 + fi +} + ensure_acme_dependencies() { command -v socat >/dev/null 2>&1 || install_package socat command -v openssl >/dev/null 2>&1 || install_package openssl + + local cron_pkg + if ! command -v crontab >/dev/null 2>&1; then + cron_pkg="$(get_cron_package_name)" + install_package "$cron_pkg" + fi } install_acme() { From 2a1a5e12ed83cd003d9280390e2487581467716a Mon Sep 17 00:00:00 2001 From: W0lfD Date: Wed, 15 Apr 2026 19:04:09 +0300 Subject: [PATCH 2/2] check acme.sh after installation --- pasarguard.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pasarguard.sh b/pasarguard.sh index 4fb71e8..3e21c05 100755 --- a/pasarguard.sh +++ b/pasarguard.sh @@ -345,8 +345,12 @@ ensure_acme_dependencies() { install_acme() { colorized_echo blue "Installing acme.sh for SSL certificate management..." if curl -s https://get.acme.sh | sh >/dev/null 2>&1; then - colorized_echo green "acme.sh installed successfully" - return 0 + local acme_bin="" + acme_bin="$(get_acme_sh_binary)" || true + if [ -n "$acme_bin" ] && [ -x "$acme_bin" ]; then + colorized_echo green "acme.sh installed successfully" + return 0 + fi fi colorized_echo red "Failed to install acme.sh" return 1