forked from ungleich-public/cdist
		
	minor optimisation ...
This commit is contained in:
		
					parent
					
						
							
								e89ca14e66
							
						
					
				
			
			
				commit
				
					
						b2aeceae91
					
				
			
		
					 1 changed files with 3 additions and 5 deletions
				
			
		|  | @ -23,11 +23,9 @@ state_should="$(cat "$__object/parameter/state")" | ||||||
| oldusermod="$(cat "$__object/explorer/oldusermod")" | oldusermod="$(cat "$__object/explorer/oldusermod")" | ||||||
| 
 | 
 | ||||||
| if [ "$oldusermod" = "true" ]; then | if [ "$oldusermod" = "true" ]; then | ||||||
|         old=yes |  | ||||||
|         addparam="-A" |         addparam="-A" | ||||||
|         delparam="-R" |         delparam="-R" | ||||||
| else | else | ||||||
|         old=no |  | ||||||
|         addparam="-a" |         addparam="-a" | ||||||
|         delparam="-d" |         delparam="-d" | ||||||
| fi | fi | ||||||
|  | @ -53,9 +51,9 @@ if [ -z "$changed_groups" ]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| for group in $changed_groups; do | for group in $changed_groups; do | ||||||
|    if [ "$old" = "no" ]; then |    if [ "$oldusermod" = "true" ]; then | ||||||
|      echo "gpasswd $action \"$user\" \"$group\"" |  | ||||||
|    else |  | ||||||
|      echo "usermod $action \"$group\" \"$user\"" |      echo "usermod $action \"$group\" \"$user\"" | ||||||
|  |    else | ||||||
|  |      echo "gpasswd $action \"$user\" \"$group\"" | ||||||
|    fi |    fi | ||||||
| done | done | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue