dotfiles/void-install/install-root.sh

16 lines
579 B
Bash
Raw Normal View History

#!/bin/sh
2022-06-09 18:22:03 +02:00
# install per-user-runsvdir in ~/sv
# drop available services in ~/.config/sv
# and link to ~/sv to enable them
2023-05-23 10:03:44 +02:00
zuser=
[ -z "$zuser" ] && echo "User is not set, please edit the script accordingly." && exit 1
2023-05-23 10:03:44 +02:00
install -d /etc/sv/runsvdir-$zuser
install -m755 sv/runsvdir/run /etc/sv/runsvdir-$zuser/run
sed -i -e "s/\@USER\@/$zuser/g" /etc/sv/runsvdir-$zuser/run
install -m755 sv/runsvdir/finish /etc/sv/runsvdir-$zuser/finish
sed -i -e "s/\@USER\@/$zuser/g" /etc/sv/runsvdir-$zuser/finish
ln -sf /run/runit/supervise.runsvdir-$zuser /etc/sv/runsvdir-$zuser/supervise