comments.bash 448 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # Prepare SSH
  3. home="/root"
  4. mkdir -p "$home/.ssh"
  5. printf "StrictHostKeyChecking no\n" > "$home/.ssh/config"
  6. chmod 0700 "$home/.ssh/config"
  7. keyfile="$home/.ssh/id_rsa"
  8. echo "$SSH_KEY" | grep -q "ssh-ed25519"
  9. if [ $? -eq 0 ]; then
  10. printf "Using ed25519 based key\n"
  11. keyfile="$home/.ssh/id_ed25519"
  12. fi
  13. echo "$SSH_KEY" > $keyfile
  14. chmod 0600 $keyfile
  15. # pull comments
  16. git clone git@c.hgit.ga:cl-syscomment.git ./content/comments