mirror of
https://github.com/FAUSheppy/config
synced 2025-12-06 07:01:36 +01:00
ii:
This commit is contained in:
@@ -29,10 +29,14 @@ def vpn():
|
||||
if hl_utils.is_cip():
|
||||
return ''
|
||||
else:
|
||||
try:
|
||||
with open(hl_utils.hlpath(VPN_LOG)) as f:
|
||||
tmp = f.read()
|
||||
tmp = ' '+tmp
|
||||
return tmp;
|
||||
except FileNotFoundError:
|
||||
return hl_utils.color_panel("NO VPN INFORMATION",YELLOW)
|
||||
|
||||
|
||||
def ip():
|
||||
try:
|
||||
@@ -52,8 +56,8 @@ def battery():
|
||||
tmp = f.read()
|
||||
tmp = ' '+tmp
|
||||
return tmp;
|
||||
except Exception as e:
|
||||
return color_panel(str(e),RED)
|
||||
except FileNotFoundError as e:
|
||||
return hl_utils.color_panel(str(e),RED)
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ def bc_pages():
|
||||
pass
|
||||
|
||||
def vpn_status():
|
||||
try:
|
||||
if not hl_utils.is_cip():
|
||||
out_vpn = hl_utils.shexec("ip r g 8.8.8.8").split("\n")[0]
|
||||
if "dev cip_tun" in out_vpn:
|
||||
@@ -210,6 +211,8 @@ def vpn_status():
|
||||
out_vpn = hl_utils.color_panel("VPN: Link Down",RED)
|
||||
with open(hl_utils.hlpath(VPN_LOG),'w') as g:
|
||||
g.write(out_vpn)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def battery_status():
|
||||
if hl_utils.is_laptop():
|
||||
|
||||
Reference in New Issue
Block a user