123456789101112131415161718192021 |
- #!/bin/bash
- #git_url_pki="https://git.sdsys.ru/iru/openvpn-pki.git"
- #git_dir_pki="openvpn-pki"
- JENKINS_MAIL="jenkins.dev@sdsys.ru"
- cd /
- GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url}
- cd /${git_dir} && git checkout $2
- serial=$(stonevpn -a | grep "$1" | awk '{print $1}')
- stonevpn -r ${serial}
- mv /${git_dir}/open/easy-rsa/client_keys/sds-$1.zip /${git_dir}/open/easy-rsa/client_keys/old-sds-$1.zip
- cd /${git_dir}
- echo "Revoke $1" > /tmp/commit.txt
- git add -A
- git config --global user.email "${JENKINS_MAIL}"
- git config --global user.name "Jenkins"
- git commit -F /tmp/commit.txt
- GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push origin $2
|