Skip to content

Commit

Permalink
interface_service: add srv_active
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitry-ishenko committed Dec 14, 2024
1 parent 69ca6b2 commit 75da88a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/modules/functions/interface_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
_srv_inside_jail() { systemd-detect-virt -qc; }

declare -A module_options
module_options+=(
["srv_active,author"]="@dimitry-ishenko"
["srv_active,desc"]="Check if service is active"
["srv_active,example"]="srv_active ssh.service"
["srv_active,feature"]="srv_active"
["srv_active,status"]="Interface"
)

srv_active()
{
# ignore inside container
_srv_inside_jail && return 1 || systemctl is-active "$@"
}

module_options+=(
["srv_disable,author"]="@dimitry-ishenko"
["srv_disable,desc"]="Disable service"
Expand Down

0 comments on commit 75da88a

Please sign in to comment.