openRC 511 B

123456789101112131415161718192021222324
  1. #!/sbin/openrc-run
  2. # Description: SquidStats Web Application
  3. name="SquidStats"
  4. description="SquidStats Web Application"
  5. command="__INSTALL_DIR__/venv/bin/python3"
  6. command_args="__INSTALL_DIR__/app.py"
  7. directory="__INSTALL_DIR__"
  8. pidfile="/run/${RC_SVCNAME}.pid"
  9. command_background=true
  10. depend() {
  11. need net
  12. after firewall
  13. }
  14. start_pre() {
  15. if [ -f "__INSTALL_DIR__/.env" ]; then
  16. set -a
  17. . "__INSTALL_DIR__/.env"
  18. set +a
  19. fi
  20. export PATH="__INSTALL_DIR__/venv/bin:$PATH"
  21. }