keygen.sh 674 B

12345678910111213141516171819202122
  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. if [ $? != 0 ];then exit 1;fi
  10. echo "Generate new key and cert for $1" > /tmp/commit.txt
  11. cd /${git_dir}
  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 $2