about summary refs log tree commit diff
path: root/xmksv
blob: 619ba26d4d1ece3990a22751292ee5179317f959 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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