dm-sv-togglestatus-libvirtd.sh 943 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # Add(Delete) qemu services to(from) autostart.
  3. if [[ -L /etc/runit/runsvdir/default/libvirtd &&
  4. -L /etc/runit/runsvdir/default/virtlockd &&
  5. -L /etc/runit/runsvdir/default/virtlogd ]]; then
  6. alacritty -e bash -c '
  7. sudo rm -f /etc/runit/runsvdir/default/libvirtd &&
  8. sudo rm -f /etc/runit/runsvdir/default/virtlockd &&
  9. sudo rm -f /etc/runit/runsvdir/default/virtlogd &&
  10. notify-send -t 5000 -i dialog-information "Delete services:" "\nlibvirtd,\nvirtlockd,\nvirtlogd\nare deleted from autostart and downed"'
  11. else
  12. alacritty -e bash -c '
  13. sudo ln -sf /etc/sv/libvirtd /etc/runit/runsvdir/default/libvirtd &&
  14. sudo ln -sf /etc/sv/virtlockd /etc/runit/runsvdir/default/virtlockd &&
  15. sudo ln -sf /etc/sv/virtlogd /etc/runit/runsvdir/default/virtlogd &&
  16. notify-send -t 5000 -i dialog-information "Add services:" "\nlibvirtd,\nvirtlockd,\nvirtlogd\nare added to autostart and upped"'
  17. fi