Add service file
This commit is contained in:
		
							
								
								
									
										43
									
								
								service/gocage
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										43
									
								
								service/gocage
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# $FreeBSD$
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# PROVIDE: gocage
 | 
				
			||||||
 | 
					# REQUIRE: LOGIN cleanvar
 | 
				
			||||||
 | 
					# KEYWORD: shutdown
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Add the following lines to /etc/rc.conf to enable :
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# gocage_enable="YES"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# gocage_conf="/usr/local/etc/gocage.conf.yml"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					. /etc/rc.subr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					name="gocage"
 | 
				
			||||||
 | 
					rcvar=gocage_enable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# read configuration and set defaults
 | 
				
			||||||
 | 
					load_rc_config "$name"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					: ${gocage_enable:="NO"}
 | 
				
			||||||
 | 
					: ${gocage_conf="/usr/local/etc/gocage.conf.yml"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					start_cmd=${name}_start
 | 
				
			||||||
 | 
					stop_cmd=${name}_stop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gocage_start()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    echo "Gocage starting jails... "
 | 
				
			||||||
 | 
					    /usr/local/bin/gocage -c ${gocage_conf} start
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gocage_stop()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    echo "Gocage stopping jails... "
 | 
				
			||||||
 | 
					    /usr/local/bin/gocage  -c ${gocage_conf} stop
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					run_rc_command "$1"
 | 
				
			||||||
		Reference in New Issue
	
	Block a user