Commit 83cbdc1f authored by Laurent Peuch's avatar Laurent Peuch

[enh] restart openvpn

parent 6f51fba3
......@@ -62,5 +62,15 @@ def from_cube():
sys.exit(1)
restart_command = "service openvpn restart"
print("Critical part 2: restart openvpn '%s'" % restart_command)
try:
subprocess.check_output(restart_command.split())
except Exception:
print("ERROR: command failed, displaying logs")
print("\n".join(open("/var/log/openvpn.log", "r").split("\n")[-200:]))
sys.exit(1)
if __name__ == '__main__':
from_cube()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment