add debian / ubuntu support for checking state
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								fe0fae6902
							
						
					
				
			
			
				commit
				
					
						559670ab4f
					
				
			
		
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -21,12 +21,19 @@
 | 
				
			||||||
# Check whether the given name will be started on boot or not
 | 
					# Check whether the given name will be started on boot or not
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -x 
 | 
				
			||||||
 | 
					exec >&2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
os=$("$__explorer/os")
 | 
					os=$("$__explorer/os")
 | 
				
			||||||
runlevel=$("$__explorer/runlevel")
 | 
					runlevel=$("$__explorer/runlevel")
 | 
				
			||||||
 | 
					name="$__object_id"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# default
 | 
				
			||||||
 | 
					state="present"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$os" in
 | 
					case "$os" in
 | 
				
			||||||
    debian|ubuntu)
 | 
					    debian|ubuntu)
 | 
				
			||||||
        echo update-rc.d \"$name\" defaults
 | 
					        [ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
 | 
				
			||||||
    ;;  
 | 
					    ;;  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    gentoo)
 | 
					    gentoo)
 | 
				
			||||||
| 
						 | 
					@ -45,3 +52,4 @@ case "$os" in
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo $state
 | 
					echo $state
 | 
				
			||||||
 | 
					exit 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue