Skip to content

Commit 04984d6

Browse files
sahsanujaapmarcus
andauthored
Avoid warning using pgrep if service name has 15 or more characters (hestiacp#4851)
* Avoid warning using pgrep if service name has 15 or more characters * Update v-list-sys-services fix prettier * Fix linting * Fix prettier * Fix linting again --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 01ca95a commit 04984d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/v-list-sys-services

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ get_srv_state() {
9393
fi
9494
used_pgrep=0
9595
if [ -z "$pids" ] && [ "$name" != 'nginx' ]; then
96-
pids=$(pgrep $name | tr '\n' '|')
96+
if [[ ${#name} -ge 15 ]]; then
97+
pids=$(pgrep -f $name | tr '\n' '|')
98+
else
99+
pids=$(pgrep $name | tr '\n' '|')
100+
fi
97101
used_pgrep=1
98102
fi
99103

0 commit comments

Comments
 (0)