__start_on_boot type: add support for OpenWRT
Signed-off-by: Giel van Schijndel <giel+cdist@mortis.eu>
This commit is contained in:
		
					parent
					
						
							
								566bfda6d2
							
						
					
				
			
			
				commit
				
					
						12d2c6c199
					
				
			
		
					 2 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
					@ -44,7 +44,7 @@ case "$os" in
 | 
				
			||||||
        done
 | 
					        done
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    debian|ubuntu)
 | 
					    debian|ubuntu|openwrt)
 | 
				
			||||||
        state="present"
 | 
					        state="present"
 | 
				
			||||||
        [ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
 | 
					        [ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,6 +47,13 @@ case "$state_should" in
 | 
				
			||||||
                echo chkconfig \"$name\" on
 | 
					                echo chkconfig \"$name\" on
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            openwrt)
 | 
				
			||||||
 | 
					                # 'enable' can be successful and still return a non-zero exit
 | 
				
			||||||
 | 
					                # code, deal with it by checking for success ourselves in that
 | 
				
			||||||
 | 
					                # case (the || ... part).
 | 
				
			||||||
 | 
					                echo "/etc/init.d/\"$name\" enable || [ -f /etc/rc.d/S??\"$name\" ]"
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            *)
 | 
					            *)
 | 
				
			||||||
               echo "Unsupported os: $os" >&2
 | 
					               echo "Unsupported os: $os" >&2
 | 
				
			||||||
               exit 1
 | 
					               exit 1
 | 
				
			||||||
| 
						 | 
					@ -74,6 +81,10 @@ case "$state_should" in
 | 
				
			||||||
                echo chkconfig \"$name\" off
 | 
					                echo chkconfig \"$name\" off
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            openwrt)
 | 
				
			||||||
 | 
					                echo "\"/etc/init.d/$name\" disable"
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            *)
 | 
					            *)
 | 
				
			||||||
               echo "Unsupported os: $os" >&2
 | 
					               echo "Unsupported os: $os" >&2
 | 
				
			||||||
               exit 1
 | 
					               exit 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue