Skip to content

Commit

Permalink
Generate Tunnelblick profiles as original user
Browse files Browse the repository at this point in the history
Improves default `open` behavior to reattach to UI namespace
  • Loading branch information
dpb587 committed Jan 6, 2018
1 parent 87c3dbc commit 6c57fee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/openvpn/client/create_tunnelblick_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ shadow="$( dirname "$0" )/config.ovpn"
file="$HOME/Library/Application Support/Tunnelblick/Configurations/$name/Contents/Resources/config.ovpn"
REM "renewing profile"
{{.Exec}} --config "{{.Config}}" --environment "{{.Environment}}" openvpn create-profile --service "{{.Service}}" > "$file.tmp"
sudo -Hnu "$USER" -- {{.Exec}} --config "{{.Config}}" --environment "{{.Environment}}" openvpn create-profile --service "{{.Service}}" > "$file.tmp"
exit=$?
if [[ "0" != "$exit" ]]; then
Expand All @@ -152,7 +152,7 @@ REM "installing profile"
mv -f "$file.tmp" "$file"
REM "installing shadow copy"
cp "$file" "$shadow"
cat "$file" > "$shadow"
REM done
`))

0 comments on commit 6c57fee

Please sign in to comment.