Created
April 11, 2013 16:09
-
-
Save bscott/5364719 to your computer and use it in GitHub Desktop.
Ruby Init Script
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
#!/usr/bin/env ruby | |
# | |
# app_name This is a startup script for use in /etc/init.d | |
# | |
# chkconfig: 2345 80 20 | |
# description: Description of program / service | |
APP_NAME = 'app_name' | |
case ARGV.first | |
when 'status': | |
status = 'stopped' | |
puts "#{APP_NAME} is #{status}" | |
when 'start': | |
# Do your thang | |
when 'stop': | |
# Do your thang | |
when 'restart': | |
# Do your thang | |
end | |
unless %w{start stop restart status}.include? ARGV.first | |
puts "Usage: #{APP_NAME} {start|stop|restart}" | |
exit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment