summaryrefslogtreecommitdiff
path: root/src/op_mode/wireguard.py
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-02-19 12:36:31 -0800
committerhagbard <vyosdev@derith.de>2019-02-19 12:36:31 -0800
commitaf63311f7a0dccd4abdae1bdc139c3fe4613249c (patch)
tree22aaebcee384ccbeda52a966d947d02ddacf0d6f /src/op_mode/wireguard.py
parent4544778df0d405be08521bb67e5a14a4944f4973 (diff)
downloadvyos-1x-af63311f7a0dccd4abdae1bdc139c3fe4613249c.tar.gz
vyos-1x-af63311f7a0dccd4abdae1bdc139c3fe4613249c.zip
fixes: T1254 - generate wireguard keypair fails when executed on the iso
- keypair can now be generated and used from the running iso to create wg tunnels on the fly
Diffstat (limited to 'src/op_mode/wireguard.py')
-rwxr-xr-xsrc/op_mode/wireguard.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/op_mode/wireguard.py b/src/op_mode/wireguard.py
index 73da72aa7..66622c04c 100755
--- a/src/op_mode/wireguard.py
+++ b/src/op_mode/wireguard.py
@@ -56,8 +56,12 @@ def genkey():
except KeyboardInterrupt:
sys.exit(0)
else:
+ """ if keypair is bing executed from a running iso """
if not os.path.exists(dir):
- os.mkdir(dir)
+ os.umask(old_umask)
+ subprocess.call(['sudo mkdir -p ' + dir], shell=True)
+ subprocess.call(['sudo chgrp vyattacfg ' + dir], shell=True)
+ subprocess.call(['sudo chmod 770 ' + dir], shell=True)
generate_keypair()
os.umask(old_umask)