about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-09-05 22:05:00 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-05 22:05:00 +0200
commit1223db6d637b9dc74a1b3371a9a5289a2ec818b6 (patch)
tree1fab6522821cf9e3ad9d072e47e3d2d9d631c597
parent0cd8162e80ab0020f2425595bdd73fc46496cb9c (diff)
downloadxtools-1223db6d637b9dc74a1b3371a9a5289a2ec818b6.tar.gz
xtools-1223db6d637b9dc74a1b3371a9a5289a2ec818b6.tar.xz
xtools-1223db6d637b9dc74a1b3371a9a5289a2ec818b6.zip
add xmksv
-rw-r--r--README1
-rwxr-xr-xxmksv14
2 files changed, 15 insertions, 0 deletions
diff --git a/README b/README
index e244a92..94a88ae 100644
--- a/README
+++ b/README
@@ -27,6 +27,7 @@ https://github.com/voidlinux/xbps
   xls PKGS... - list files contained in PKGS (including binpkgs)
   xmandoc MANPAGE - read manpage of possibly not installed package
   xmindep PKGS... - minimize list of PKGS by removing implicit dependencies
+  xmksv [NEWSVDIR...] - create new runit service templates
   xmypkgs [EMAIL] - list all pkgs maintained by you (or EMAIL)
   xnew PKG - create XBPS template template
   xnodev - list not installed -devel packages for installed packages
diff --git a/xmksv b/xmksv
new file mode 100755
index 0000000..619ba26
--- /dev/null
+++ b/xmksv
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+# xmksv [NEWSVDIR...] - create new runit service templates
+
+cd ${SVDIR:-/etc/sv}
+
+for SRV; do
+	mkdir "$SRV"
+	touch "$SRV/down"
+	echo "#!/bin/sh" | install -m755 /dev/stdin "$SRV/run"
+	if [ -w /run/runit ]; then
+		ln -s /run/runit/supervise."$(printf %s "$SRV" | tr / -)" \
+			"$SRV/supervise"
+	fi
+done