Tunnel Start and Stop Work
This commit is contained in:
20
wg_func.py
Normal file
20
wg_func.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Wireguard functions for Wire-Py
|
||||
import os
|
||||
|
||||
|
||||
def active(): # Shows the active tunnel
|
||||
a = os.popen('nmcli connection show --active | grep -iPo "(.*)(wireguard)"').read().split()
|
||||
if not a:
|
||||
a = ''
|
||||
|
||||
return a
|
||||
else:
|
||||
a = a[0]
|
||||
return a
|
||||
|
||||
|
||||
def tl_list():
|
||||
wg_s = os.popen('nmcli connection show | grep -iPo "(.*)(wireguard)"').read().split()
|
||||
tl = wg_s[::3] # tl = Tunnelliste # Hiermit wird jedes 4. Element der Liste gezeigt
|
||||
return tl
|
||||
|
Reference in New Issue
Block a user