mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
check_if_service_exists() function
This commit is contained in:
parent
591bd21615
commit
c7b872b778
1 changed files with 8 additions and 0 deletions
|
@ -1114,3 +1114,11 @@ send_email_to_admin() {
|
|||
fi
|
||||
echo "$2" | $SENDMAIL -s "$1" "$email" 'yes'
|
||||
}
|
||||
|
||||
check_if_service_exists() {
|
||||
if [ $(systemctl list-units --all -t service --full --no-legend | grep -c "$1") -gt 0 ]; then
|
||||
echo "1"
|
||||
else
|
||||
echo "0"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue