BinaryONe commited on
Commit
d8eca31
·
1 Parent(s): d0ac321
Files changed (1) hide show
  1. start.sh +2 -1
start.sh CHANGED
@@ -67,9 +67,10 @@ add_admin_authorized_keys() {
67
 
68
  # Function to add SSH private key to the SSH agent
69
  add_ssh_key_to_agent() {
 
70
  if ! ssh-add -l | grep -q '/home/admin/.ssh/id_rsa'; then
71
  echo "* Adding SSH private key to the SSH agent *"
72
- ssh-add /home/admin/.ssh/id_rsa || { echo "Failed to add SSH private key to agent"; exit 1; }
73
  fi
74
  }
75
 
 
67
 
68
  # Function to add SSH private key to the SSH agent
69
  add_ssh_key_to_agent() {
70
+ ssh-add -D # Remove all existing keys from the SSH agent
71
  if ! ssh-add -l | grep -q '/home/admin/.ssh/id_rsa'; then
72
  echo "* Adding SSH private key to the SSH agent *"
73
+ ssh-add /home/admin/.ssh/id_rsa
74
  fi
75
  }
76