Skip to content

Commit

Permalink
[openvpn] forgot to add tactic scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 3, 2012
1 parent d5a5623 commit c27ce75
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions client_tactics/openvpn/openvpn_append_device.sh
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -e

# ./openvpn_append_device.sh haris.d2 debian.d2 signpo.st haris.d2.signpo.st conf/ tmp/
local_node=$1
remote_node=$2
domain=$3
dst_domain=$4
conf_dir=$5
tmp_dir=$6

# create tmp folder
remote_host=$remote_node.$domain
local_host=$local_node.$domain
dst_dir=$tmp_dir/$dst_domain/

if [ ! -e $dst_dir ]; then
exit 1
fi

# sign the remote domain certificate
echo fetching key $remote_host
crypto-convert \
-k $remote_host \
-t DNS_PUB \
-p $conf_dir/signpost.pem \
-a sign \
-s "C=UK,O=signpost,CN=$remote_host," \
-i "C=UK,O=signpost,CN=$local_host," \
-T PEM_CERT \
-D 30758400 \
-K $dst_dir/allowed-$remote_host.crt

cat $dst_dir/tmp.crt $dst_dir/allowed-*.crt > $dst_dir/ca.crt

0 comments on commit c27ce75

Please sign in to comment.