summarylogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rwxr-xr-xservice23
1 files changed, 23 insertions, 0 deletions
diff --git a/service b/service
new file mode 100755
index 000000000000..3419ddbe1d1e
--- /dev/null
+++ b/service
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+#
+# wrapper around systemctl used by Xerox driver.
+#
+# Xerox's xeroxprtmgr invokes 'service cups restart', which will fail on systemd systems. This script "translates" the
+# service invocation to a systemctl invocation.
+#
+
+set -e
+
+SERVICE=$1
+COMMAND=$2
+
+if [ $SERVICE == "cups" ]; then
+ SERVICE=cups.service
+else
+ SERVICE=$SERVICE.service
+fi
+
+echo "systemctl $COMMAND $SERVICE"
+
+systemctl $COMMAND $SERVICE