Advertisement
Guest User

Untitled

a guest
May 29th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # PROVIDE: mastodon
  4. # REQUIRE: LOGIN
  5. # BEFORE: securelevel
  6. # KEYWORD: shutdown
  7.  
  8. # Add the following line to /etc/rc.conf to enable `mastodon':
  9. #
  10. #mastodon_enable="YES"
  11.  
  12. export PATH="/usr/local/bin:/bin:/usr/bin"
  13.  
  14. . /etc/rc.subr
  15.  
  16. name="mastodon"
  17. rcvar="${name}_enable"
  18.  
  19. load_rc_config "$name"
  20. : ${mastodon_enable="NO"}
  21. : ${mastodon_path="/usr/local/www/mastodon"}
  22. : ${mastodon_env="production"}
  23.  
  24. start_cmd=${name}_start
  25. stop_cmd=${name}_stop
  26.  
  27. mastodon_start() {
  28. export RAILS_ENV=$mastodon_env
  29. cd $mastodon_path
  30. bundle exec rails server puma
  31. }
  32.  
  33. mastodon_stop() {
  34. kill `cat $mastodon_path/tmp/pids/puma.pid`
  35. }
  36.  
  37. run_rc_command "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement