keygen.sh 644 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. #git_url="ssh://git@git.sdsys.ru:8022/iru/openvpn-pki.git"
  3. #git_dir_pki="openvpn-pki"
  4. JENKINS_MAIL="jenkins.dev@sdsys.ru"
  5. cd /
  6. GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url}
  7. cd /${git_dir} && git checkout $2
  8. stonevpn -f $1 -n "$1" -z
  9. echo "Generate new key and cert for $1" > /tmp/commit.txt
  10. cd /${git_dir}
  11. git add -A
  12. git config --global user.email "${JENKINS_MAIL}"
  13. git config --global user.name "Jenkins"
  14. git commit -F /tmp/commit.txt
  15. GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push origin $2