initial commit of file from CVS for e-smith-base on Thu 26 Oct 11:24:52 BST 2023
This commit is contained in:
30
root/sbin/e-smith/service-status
Normal file
30
root/sbin/e-smith/service-status
Normal file
@@ -0,0 +1,30 @@
|
||||
#! /bin/sh
|
||||
|
||||
SERVICE=$1
|
||||
USAGE="Usage: service-status SERVICENAME"
|
||||
|
||||
#if no servicename is provided return usage
|
||||
if [[ "${SERVICE}" == "" ]]
|
||||
then
|
||||
echo ${USAGE} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TYPE=$(/sbin/e-smith/db configuration gettype "$SERVICE" || echo none)
|
||||
|
||||
if [[ "$TYPE" != 'service' ]]
|
||||
then
|
||||
echo "$SERVICE is not a service"
|
||||
exit 9
|
||||
fi
|
||||
|
||||
STATUS=$(/sbin/e-smith/db configuration getprop "$SERVICE" status || echo disabled)
|
||||
|
||||
if [[ "$STATUS" != 'enabled' ]]
|
||||
then
|
||||
echo "$SERVICE status not enabled in configuration db."
|
||||
exit 0
|
||||
# change this one to 5 if you want systemd to fail on ExecStartPre
|
||||
fi
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user