fix for non sudo user install

This commit is contained in:
Kaladin Light 2016-04-21 12:28:48 -04:00
parent 0b50af3ea2
commit 04eb49116f

View file

@ -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