summaryrefslogtreecommitdiff
path: root/packaging/hp-systray.wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/hp-systray.wrapper')
-rw-r--r--packaging/hp-systray.wrapper17
1 files changed, 17 insertions, 0 deletions
diff --git a/packaging/hp-systray.wrapper b/packaging/hp-systray.wrapper
new file mode 100644
index 0000000..60053f1
--- /dev/null
+++ b/packaging/hp-systray.wrapper
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+# Be polite and sleep a bit to let more important processes go ahead
+# (in particular after booting let the cupsd finish its startup):
+sleep 10
+# Run hp-systray only if an appropriate local print queue exists
+# (i.e. on localhost a queue with a "hp:/..." DeviceURI)
+# see https://bugzilla.novell.com/show_bug.cgi?id=649280
+# otherwise and in case of any error do an unnoticeable exit:
+set -o pipefail
+lpstat -h localhost -v | grep -q ': hp:/' || exit 0
+# Replace this wrapper with the actual command
+# so that it exits with the exit code of the command
+# and that the command gets any signals directly,
+# see https://bugzilla.novell.com/show_bug.cgi?id=499735
+exec hp-systray
+