From 6bf16e5f3edc68bd32021c3485bb496c517575f3 Mon Sep 17 00:00:00 2001 From: Von Random Date: Tue, 4 Oct 2016 11:08:47 +0300 Subject: [PATCH] add autostart example for simple wms --- autostart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 autostart diff --git a/autostart b/autostart new file mode 100755 index 0000000..f20f137 --- /dev/null +++ b/autostart @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh +# +# A simple autostart script so that I don't have to write it again for each of +# my installations. +function check_start +{ + # check if the service is running and, if not, start it in the background + # and detach + service=$1 + if pgrep -u $USER ${service} >/dev/null; then + return 0 + else + ${service} & + disown + fi +} +#check_start nm-applet