|
@@ -0,0 +1,21 @@
|
|
|
+#!/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_pki}
|
|
|
+cd /${git_dir_pki} && git checkout $2
|
|
|
+
|
|
|
+serial=$(stonevpn -a | grep "$1" | awk '{print $1}')
|
|
|
+stonevpn -r ${serial}
|
|
|
+
|
|
|
+cd /${git_dir_pki}
|
|
|
+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
|