Skip to content

Commit

Permalink
Use newgrp instead of sg
Browse files Browse the repository at this point in the history
This solves the issue that `sg` does not forward SIGTERM
  • Loading branch information
hansbogert authored May 14, 2018
1 parent 2de9a99 commit 722a42f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openvpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,6 @@ else
[[ -e $conf ]] || { echo "ERROR: VPN not configured!"; sleep 120; }
[[ -e $cert ]] || grep -q '<ca>' $conf ||
{ echo "ERROR: VPN CA cert missing!"; sleep 120; }
exec sg vpn -c "openvpn --cd $dir --config $conf"
fi
newgrp vpn
exec openvpn --cd $dir --config $conf
fi

0 comments on commit 722a42f

Please sign in to comment.