mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-23 13:20:16 +00:00
fix for non sudo user install
This commit is contained in:
parent
0b50af3ea2
commit
04eb49116f
1 changed files with 3 additions and 2 deletions
|
@ -498,14 +498,15 @@ confOpenVPN () {
|
||||||
|
|
||||||
# Write config file for server using the template .txt file
|
# Write config file for server using the template .txt file
|
||||||
LOCALIP=$(ifconfig $pivpnInterface | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*')
|
LOCALIP=$(ifconfig $pivpnInterface | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*')
|
||||||
$SUDO sed 's/LOCALIP/'$LOCALIP'/' </etc/.pivpn/server_config.txt >/etc/openvpn/server.conf
|
$SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf
|
||||||
|
$SUDO sed -i "s/LOCALIP/${LOCALIP}/g" /etc/openvpn/server.conf
|
||||||
if [ $ENCRYPT = 2048 ]; then
|
if [ $ENCRYPT = 2048 ]; then
|
||||||
$SUDO sed -i 's:dh1024:dh2048:' /etc/openvpn/server.conf
|
$SUDO sed -i 's:dh1024:dh2048:' /etc/openvpn/server.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if they modified port put value in server.conf
|
# if they modified port put value in server.conf
|
||||||
if [ $PORT != 1194 ]; then
|
if [ $PORT != 1194 ]; then
|
||||||
$SUDO sed -i -e "s/1194/${PORT}/g" /etc/openvpn/server.conf
|
$SUDO sed -i "s/1194/${PORT}/g" /etc/openvpn/server.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# write out server certs to conf file
|
# write out server certs to conf file
|
||||||
|
|
Loading…
Reference in a new issue