bootstrap.sh 667 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # Simple bootstrap script to build and run the daemon
  3. if [ "$EUID" -eq 0 ]
  4. then echo "Please don't run bootstrap.sh as root."
  5. exit
  6. fi
  7. set -e
  8. # Echo the rest so it's obvious
  9. set -x
  10. meson --prefix=/usr build -Dwith-systemd-user-unit-dir=/etc/systemd/user
  11. cd build
  12. ninja
  13. # Verify user wants to install
  14. set +x
  15. read -p "Install to /usr? [Yy] " -r
  16. [[ $REPLY =~ ^[Yy]$ ]]
  17. set -x
  18. sudo ninja install
  19. # Verify user wants to run the daemon
  20. set +x
  21. read -p "Enable and run the daemon? [Yy] " -r
  22. [[ $REPLY =~ ^[Yy]$ ]]
  23. set -x
  24. systemctl --user daemon-reload
  25. systemctl --user enable gamemoded
  26. systemctl --user start gamemoded
  27. systemctl --user status gamemoded