Blame public/fs/etc/openvpn/hostvpn-conf.sh
|
root@culturestrings |
76b152 |
#!/bin/sh
|
|
root@culturestrings |
76b152 |
|
|
root@culturestrings |
76b152 |
set -eu
|
|
root@culturestrings |
76b152 |
|
|
root@culturestrings |
0a05a5 |
sitezone="$1"
|
|
root@culturestrings |
0a05a5 |
|
|
root@culturestrings |
0a05a5 |
cfg_script="$0"
|
|
root@culturestrings |
0a05a5 |
cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P)
|
|
root@culturestrings |
0a05a5 |
|
|
root@culturestrings |
b0963f |
source /root/config/private/config/server.ports
|
|
root@culturestrings |
0a05a5 |
source /root/config/private/config/hostinfo/${sitezone}
|
|
root@culturestrings |
76b152 |
|
|
root@culturestrings |
a75d12 |
if [ ${vpn_route_all} = 'yes' ]; then
|
|
root@culturestrings |
a75d12 |
vpn_route_all_subst='s/^@vpn_route_all@ //g'
|
|
root@culturestrings |
a75d12 |
else
|
|
root@culturestrings |
a75d12 |
vpn_route_all_subst='/^@vpn_route_all@ /d'
|
|
root@culturestrings |
a75d12 |
fi
|
|
root@culturestrings |
a75d12 |
|
|
root@culturestrings |
89dca3 |
sed -e 's/@vpn_port@/'${vpn_port}'/g' \
|
|
root@culturestrings |
89dca3 |
-e 's/@hostname@/'${hostname}'/g' \
|
|
root@culturestrings |
2caf08 |
-e 's/@vpn_net4@/'${vpn_net4}'/g' \
|
|
root@culturestrings |
2caf08 |
-e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \
|
|
root@culturestrings |
2caf08 |
-e 's/@host_ipv4@/'${host_ipv4}'/g' \
|
|
root@culturestrings |
2caf08 |
-e 's/@host_ipv6@/'${host_ipv6}'/g' \
|
|
root@culturestrings |
a75d12 |
-e "${vpn_route_all_subst}" \
|
|
root@culturestrings |
0a05a5 |
"${cfg_srcdir}/hostvpn.conf.in"
|