Created
May 29, 2017 09:31
-
-
Save pooza/c249f3bc56744b15758bcfd805093381 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: mastodon | |
# REQUIRE: LOGIN | |
# BEFORE: securelevel | |
# KEYWORD: shutdown | |
# Add the following line to /etc/rc.conf to enable `mastodon': | |
# | |
#mastodon_enable="YES" | |
export PATH="/usr/local/bin:/bin:/usr/bin" | |
. /etc/rc.subr | |
name="mastodon" | |
rcvar="${name}_enable" | |
load_rc_config "$name" | |
: ${mastodon_enable="NO"} | |
: ${mastodon_path="/usr/local/www/mastodon"} | |
: ${mastodon_env="production"} | |
start_cmd=${name}_start | |
stop_cmd=${name}_stop | |
mastodon_start() { | |
export RAILS_ENV=$mastodon_env | |
cd $mastodon_path | |
bundle exec rails server puma | |
} | |
mastodon_stop() { | |
kill `cat $mastodon_path/tmp/pids/puma.pid` | |
} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment