1 |
jpp |
1.1 |
diff -Nur e-smith-base-5.8.0.old/root/sbin/e-smith/service-status e-smith-base-5.8.0/root/sbin/e-smith/service-status |
2 |
|
|
--- e-smith-base-5.8.0.old/root/sbin/e-smith/service-status 1969-12-31 19:00:00.000000000 -0500 |
3 |
|
|
+++ e-smith-base-5.8.0/root/sbin/e-smith/service-status 2020-11-08 23:29:19.672000000 -0500 |
4 |
|
|
@@ -0,0 +1,29 @@ |
5 |
|
|
+#! /bin/sh |
6 |
|
|
+ |
7 |
|
|
+SERVICE=$1 |
8 |
|
|
+USAGE="Usage: service-status SERVICENAME" |
9 |
|
|
+ |
10 |
|
|
+#if no servicename is provided return usage |
11 |
|
|
+if [[ "${SERVICE}" == "" ]] |
12 |
|
|
+then |
13 |
|
|
+ echo ${USAGE} >&2 |
14 |
|
|
+ exit 1 |
15 |
|
|
+fi |
16 |
|
|
+ |
17 |
|
|
+TYPE=$(/sbin/e-smith/db configuration gettype "$SERVICE" || echo none) |
18 |
|
|
+ |
19 |
|
|
+if [[ "$TYPE" != 'service' ]] |
20 |
|
|
+then |
21 |
|
|
+ echo "$SERVICE is not a service" |
22 |
|
|
+ exit 9 |
23 |
|
|
+fi |
24 |
|
|
+ |
25 |
|
|
+STATUS=$(/sbin/e-smith/db configuration getprop "$SERVICE" status || echo disabled) |
26 |
|
|
+ |
27 |
|
|
+if [[ "$STATUS" != 'enabled' ]] |
28 |
|
|
+then |
29 |
|
|
+ echo "$SERVICE will not start (service status not enabled)" |
30 |
|
|
+ exit 5 |
31 |
|
|
+fi |
32 |
|
|
+ |
33 |
|
|
+exit 0 |