summaryrefslogtreecommitdiffstats
path: root/retiolum/bin
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/bin')
-rwxr-xr-xretiolum/bin/pgrep-retiolum-tincd-args2
-rwxr-xr-xretiolum/bin/restart-tincd14
2 files changed, 16 insertions, 0 deletions
diff --git a/retiolum/bin/pgrep-retiolum-tincd-args b/retiolum/bin/pgrep-retiolum-tincd-args
new file mode 100755
index 00000000..bd0bbc97
--- /dev/null
+++ b/retiolum/bin/pgrep-retiolum-tincd-args
@@ -0,0 +1,2 @@
+#! /bin/sh
+ps -e -o args | grep -E '(^|[ /])tincd +.* (-n +|--net=)retiolum'
diff --git a/retiolum/bin/restart-tincd b/retiolum/bin/restart-tincd
new file mode 100755
index 00000000..17d939d9
--- /dev/null
+++ b/retiolum/bin/restart-tincd
@@ -0,0 +1,14 @@
+#! /bin/sh
+set -xeuf
+
+PATH="$(dirname $(readlink -f "$0"))${PATH+:$PATH}"
+
+if args="`pgrep-retiolum-tincd-args`"; then
+ while $args --kill; do
+ sleep 1
+ done
+ $args
+else
+ echo "$0: there is no retiolum tincd process to restart" >&2
+ exit 23
+fi