add ssh-loop shell helpers for FC infra
This commit is contained in:
		
							parent
							
								
									651b93da89
								
							
						
					
					
						commit
						f2917af591
					
				
					 2 changed files with 21 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -524,7 +524,8 @@ programs.bat = {
 | 
			
		|||
          realpath $(${pkgs.which}/bin/which $1)
 | 
			
		||||
        }
 | 
			
		||||
        ''
 | 
			
		||||
        + (import ./scripts/reporsync.nix {inherit pkgs;});
 | 
			
		||||
        + (import ./scripts/reporsync.nix {inherit pkgs;})
 | 
			
		||||
        + (import ./scripts/ssh-loop-fc.nix {inherit pkgs;});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      oh-my-zsh = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								home/scripts/ssh-loop-fc.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								home/scripts/ssh-loop-fc.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
{pkgs, ...}:
 | 
			
		||||
''
 | 
			
		||||
ssh-loop () {
 | 
			
		||||
    setopt shwordsplit
 | 
			
		||||
    local hosts=$1
 | 
			
		||||
    local cmd=$2
 | 
			
		||||
 | 
			
		||||
    for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh  $x.fcio.net -o StrictHostKeyChecking=no -C "$2"; done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ssh-loop-parallel () {
 | 
			
		||||
    setopt shwordsplit
 | 
			
		||||
    local hosts=$1
 | 
			
		||||
    local cmd=$2
 | 
			
		||||
 | 
			
		||||
    for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh  $x.fcio.net -o StrictHostKeyChecking=no -C "$2" 2>&1 | sed -e "s/^/$x: /;" & done
 | 
			
		||||
    wait
 | 
			
		||||
}
 | 
			
		||||
''
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue