#!/usr/bin/env bash

if [ "$GETSSL_OS" = "alpine" ]; then
    killall -HUP nginx
    sleep 5
elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then
    pgrep nginx | head -1 | xargs kill -HUP
    sleep 5
elif [[ "$GETSSL_OS" == "centos6" ]]; then
    service nginx restart 3>&- 4>&-
    # service nginx restart
else
    service nginx restart >/dev/null 3>&- 4>&-
fi
