mirror of
https://github.com/fccview/cronmaster.git
synced 2026-01-18 10:47:42 -05:00
14 lines
361 B
Bash
14 lines
361 B
Bash
# @id: check-service
|
|
# @title: Check service status
|
|
# @description: Check if service is running and restart if not
|
|
# @category: System Operations
|
|
# @tags: service,check,monitor,restart
|
|
|
|
# Check service status
|
|
# Restart service if not running
|
|
|
|
SERVICE_NAME="nginx"
|
|
|
|
if ! systemctl is-active --quiet "$SERVICE_NAME"; then
|
|
systemctl restart "$SERVICE_NAME"
|
|
fi |