First Try
This commit is contained in:
		
							
								
								
									
										33
									
								
								apps/aarch64-darwin/check-keys
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										33
									
								
								apps/aarch64-darwin/check-keys
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
RED='\033[0;31m'
 | 
			
		||||
GREEN='\033[0;32m'
 | 
			
		||||
NC='\033[0m'
 | 
			
		||||
 | 
			
		||||
username=${USER}
 | 
			
		||||
export SSH_DIR=/Users/${username}/.ssh
 | 
			
		||||
 | 
			
		||||
lint_keys() {
 | 
			
		||||
  if [[ -f "${SSH_DIR}/id_ed25519" && -f "${SSH_DIR}/id_ed25519.pub" && -f "${SSH_DIR}/id_ed25519_agenix" && -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
 | 
			
		||||
    echo -e "${GREEN}All SSH keys are present.${NC}"
 | 
			
		||||
  else
 | 
			
		||||
    echo -e "${RED}Some SSH keys are missing.${NC}"
 | 
			
		||||
    if [[ ! -f "${SSH_DIR}/id_ed25519" ]]; then
 | 
			
		||||
      echo -e "${RED}Missing: id_ed25519${NC}"
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ ! -f "${SSH_DIR}/id_ed25519.pub" ]]; then
 | 
			
		||||
      echo -e "${RED}Missing: id_ed25519.pub${NC}"
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ ! -f "${SSH_DIR}/id_ed25519_agenix" ]]; then
 | 
			
		||||
      echo -e "${RED}Missing: id_ed25519_agenix${NC}"
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ ! -f "${SSH_DIR}/id_ed25519_agenix.pub" ]]; then
 | 
			
		||||
      echo -e "${RED}Missing: id_ed25519_agenix.pub${NC}"
 | 
			
		||||
    fi
 | 
			
		||||
    echo -e "${GREEN}Run the createKeys command to generate the missing keys.${NC}"
 | 
			
		||||
    exit 1
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lint_keys
 | 
			
		||||
		Reference in New Issue
	
	Block a user