Ignore:
Timestamp:
02/28/18 18:24:39 (7 years ago)
Author:
Edwin Eefting <edwin@datux.nl>
Branches:
master, perl-5.22
Children:
669bb09
Parents:
df958d5 (diff), 90f43e5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'gcc484'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/internetserver/openvpn_conf/root/service/openvpn/run

    rdf958d5 r031ab69  
    11#!/bin/bash
     2
     3set -e
     4
     5cd /etc/openvpn
     6
     7# key generation moved here, otherwise it takes too long (now the system is generating more entrophy because it continues to start)
     8
     9
     10#basic setup
     11if ! [ -e pki ]; then
     12        ./easyrsa init-pki
     13fi
     14
     15#create ca cert
     16if ! [ -e pki/ca.crt ]; then
     17        echo syn3 | ./easyrsa build-ca nopass
     18fi
     19
     20#create server cert
     21if ! [ -e pki/issued/server.crt ]; then
     22        ./easyrsa build-server-full server nopass
     23fi
     24
     25#create dh parameters
     26if ! [ -e pki/dh.pem ]; then
     27        ./easyrsa gen-dh
     28fi
     29
     30#create CRL list
     31if ! [ -e pki/crl.pem ]; then
     32        ./easyrsa gen-crl
     33fi
     34
     35#openvpn group
     36if ! ( getent group | grep "OpenVPN access" &> /dev/null ) ; then
     37 smbldap-groupadd -g 521 "OpenVPN access" || exit 1;
     38fi
     39
     40#openvpn ipblock
     41NAME="OpenVPN clients"
     42if ! grep "$NAME" /etc/firewall/ipblocks; then
     43        echo "$NAME='10.8.0.0/24'" >> /etc/firewall/ipblocks
     44fi
     45
     46#create tlsauth key
     47if ! [ -e pki/ta.key ]; then
     48        openvpn --genkey --secret pki/ta.key
     49fi
     50
    251
    352modprobe tun
    453
    5 cd /etc/openvpn
    654exec openvpn --config openvpn.conf --config openvpn_syn3.conf  --config openvpn_custom.conf
Note: See TracChangeset for help on using the changeset viewer.