check_cert_for_service.sh: fix error in using systemctl for start/stop/rdaemon-reload.

This commit is contained in:
2026-04-17 09:25:51 +02:00
parent fa08826bff
commit a8d895e1b2

View File

@@ -315,19 +315,19 @@ if $restart_service ; then
_failed=false _failed=false
echononl "Going to restart Service '${service_name}' .." echononl "Going to restart Service '${service_name}' .."
if [[ -n "$SYSTEMD_SERVICE" ]] ; then if [[ -n "$SYSTEMD_SERVICE" ]] ; then
$systemctl daemon-reload > $log_file 2>&1 systemctl daemon-reload > $log_file 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_failed=true _failed=true
fi fi
sleep 2 sleep 2
$systemctl stop $SYSTEMD_SERVICE >> $log_file 2>&1 systemctl stop $SYSTEMD_SERVICE >> $log_file 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_failed=true _failed=true
fi fi
sleep 10 sleep 10
$systemctl start $SYSTEMD_SERVICE >> $log_file 2>&1 systemctl start $SYSTEMD_SERVICE >> $log_file 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_failed=true _failed=true
fi fi