keygen.sh 799 B

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