only install/deinstall apt packages if necessary
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								c90ae945a8
							
						
					
				
			
			
				commit
				
					
						3a10475151
					
				
			
		
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -27,14 +27,18 @@ else | ||||||
|    name="$__object_id" |    name="$__object_id" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| state=$(cat "$__object/parameter/state") | state="$(cat "$__object/parameter/state")" | ||||||
| 
 | 
 | ||||||
| case "$state" in | case "$state" in | ||||||
|    installed) |    installed) | ||||||
|  |       pkg_status="$(cat "$__object/explorer/pkg_status")" | ||||||
|  |       if [ "$pkg_status" != "ii" ]; then | ||||||
|          echo apt-get --quiet --yes install \"$name\" |          echo apt-get --quiet --yes install \"$name\" | ||||||
|  |       fi | ||||||
|    ;; |    ;; | ||||||
|    deinstalled) |    deinstalled) | ||||||
|  |       if [ "$pkg_status" != "un" ]; then | ||||||
|          echo apt-get --quiet --yes remove \"$name\" |          echo apt-get --quiet --yes remove \"$name\" | ||||||
|  |       fi | ||||||
|    ;; |    ;; | ||||||
| esac | esac | ||||||
| 
 |  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue