Skip to content

Commit

Permalink
Add an ignored service list to checkservices to avoid useless parsing…
Browse files Browse the repository at this point in the history
… errors

This commit aims to introduce an ignored service list that can be completed with every service known to create parsing errors
Fixes #44
  • Loading branch information
Antiz96 committed Jul 15, 2024
1 parent c53a022 commit 3ef0a2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion admin/checkservices
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ SERIALIZE=0 # run in parallel
STATUS=1 # display status after systemctl
USER_SLICE=0 # act on users services

# ignored service list
IGNORED_SERVICE=("getty@tty.*.service")

# print $* as an arrow line
arrow() {
printf "${C_BOLD}${C_BLUE}:: ${C_WHITE}%s${C_RESET}\n" "$*"
Expand Down Expand Up @@ -102,7 +105,7 @@ confirm() {

# get running systemd services
get_services() {
systemctl --no-legend --full --type service --state running | tr -d '' | awk '{print $1}'
systemctl --no-legend --full --type service --state running | tr -d '' | awk '{print $1}' | grep -v $(printf -- '-e %s ' "${IGNORED_SERVICE[@]}")
}

# get systemd services with updated mapped files
Expand Down

0 comments on commit 3ef0a2a

Please sign in to comment.