Preserve cwd.
This commit is contained in:
parent
10e22ef9f6
commit
2cc855484b
2 changed files with 3 additions and 2 deletions
|
@ -33,8 +33,7 @@ print_ip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_user() {
|
switch_user() {
|
||||||
cd "$OVPN_HOME" || exit 1
|
su -c "cd $OVPN_WORKDIR && "'$SHELL' -l "$OVPN_USER"
|
||||||
su - "$OVPN_USER"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
own_ip="$(get_ip)"
|
own_ip="$(get_ip)"
|
||||||
|
|
|
@ -32,8 +32,10 @@ docker run -it --cap-add NET_ADMIN \
|
||||||
-v /etc/passwd:/etc/passwd \
|
-v /etc/passwd:/etc/passwd \
|
||||||
-v "$ovpn_configuration_file_parent_dir:$ovpn_configuration_file_parent_dir" \
|
-v "$ovpn_configuration_file_parent_dir:$ovpn_configuration_file_parent_dir" \
|
||||||
-v "$HOME:$HOME" \
|
-v "$HOME:$HOME" \
|
||||||
|
-v "$PWD:/data/" \
|
||||||
-e OVPN_USER="$USER" \
|
-e OVPN_USER="$USER" \
|
||||||
-e OVPN_HOME="$HOME" \
|
-e OVPN_HOME="$HOME" \
|
||||||
|
-e OVPN_WORKDIR="/data/" \
|
||||||
-e OVPN_CONFIGURATION_FILE="$ovpn_configuration_file" \
|
-e OVPN_CONFIGURATION_FILE="$ovpn_configuration_file" \
|
||||||
"$TAG" sh
|
"$TAG" sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue