Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[openvpn] forgot to add tactic scripts
- Loading branch information
root
committed
Apr 3, 2012
1 parent
d5a5623
commit c27ce75
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |