Browse Source

Add revoke.sh see Redmine 97009

Admin User 6 years ago
parent
commit
0f39b4a7e5
1 changed files with 21 additions and 0 deletions
  1. 21 0
      revoke.sh

+ 21 - 0
revoke.sh

@@ -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