dis2hook.initd 617 B

12345678910111213141516171819202122232425262728
  1. #!/sbin/openrc-run
  2. # Dis2Hook — webhook relay to Discord bot (Alpine OpenRC service)
  3. name="dis2hook"
  4. description="Dis2Hook webhook relay to Discord"
  5. directory="/opt/dis2hook"
  6. command="/usr/bin/python3"
  7. command_args="/opt/dis2hook/app.py"
  8. supervisor="supervise-daemon"
  9. output_log="/var/log/dis2hook.log"
  10. error_log="/var/log/dis2hook.log"
  11. respawn_delay=5
  12. respawn_max=0
  13. depend() {
  14. need net
  15. after firewall
  16. }
  17. start_pre() {
  18. checkpath -f -m 0644 /var/log/dis2hook.log
  19. if [ ! -f "$directory/token.json" ]; then
  20. eerror "token.json missing — run the installer first."
  21. return 1
  22. fi
  23. }