-
Notifications
You must be signed in to change notification settings - Fork 55
/
init.sh
48 lines (38 loc) · 1.02 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
# Preload iptables,Rule lost when preventing restart of container!
iptables-restore < /etc/sysconfig/iptables
# Repair gcp container restart, can not access google family bucket(Disable pmtu discovery!)
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv4.ip_no_pmtu_disc=1
# Setting eap-radius config info
if [ -z "$ACCOUNTING" ]; then
export ACCOUNTING=no
fi
if [ -z "$RADIUS_PORT" ]; then
export RADIUS_PORT=1812
fi
if [ -z "$RADIUS_SERVER" ]; then
export RADIUS_SERVER=''
fi
if [ -z "$RADIUS_SECRET" ]; then
export RADIUS_SECRET=''
fi
envsubst '
${ACCOUNTING}
${RADIUS_PORT}
${RADIUS_SERVER}
${RADIUS_SECRET}
' < eap-radius.conf.template > /usr/local/etc/strongswan.d/charon/eap-radius.conf
# Setting eap auth type
if [ -z "$EAP_TYPE" ]; then
export EAP_TYPE='eap-mschapv2'
fi
if [ -z "$HOST_IP" ]; then
export HOST_IP='0.0.0.0'
fi
envsubst '
${EAP_TYPE}
${HOST_IP}
' < ipsec.conf.template > /usr/local/etc/ipsec.conf
exec "$@"