diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-04 20:55:28 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-04 20:55:28 +0200 |
commit | 3ddb341f412d044643b00e7eb71618b0f20ee602 (patch) | |
tree | b698d5964ddbbba0782e40eb98a065a6379edff6 | |
parent | 95beffcb8b8e69afdf2b83dfe5c4b01e515c67d6 (diff) | |
download | 0tdns-3ddb341f412d044643b00e7eb71618b0f20ee602.tar.gz 0tdns-3ddb341f412d044643b00e7eb71618b0f20ee602.zip |
tag namespace name with more unique shell's PID instead of timestamp
-rwxr-xr-x | src/vpn_wrapper.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vpn_wrapper.sh b/src/vpn_wrapper.sh index b4b9350..5d6b034 100755 --- a/src/vpn_wrapper.sh +++ b/src/vpn_wrapper.sh @@ -4,12 +4,11 @@ OPENVPN_CONFIG="$1" # rest of args is the command to run in network namespace shift -# just in case something causes more instances of this script -# to run simultaneously, we timestamp some names -SECONDS=`date '+%s'` +# to enable multiple instances of this script to run simultaneously, +# we tag namespace name and file names with this shell's PID -HELPER_SCRIPT=/var/lib/0tdns/helper_script$SECONDS.sh -NAMESPACE_NAME=0tdns$SECONDS +HELPER_SCRIPT=/var/lib/0tdns/helper_script$$.sh +NAMESPACE_NAME=0tdns$$ # we create another script as a way of passing variables # to netns-script |