#!/usr/bin/env python
#-*-coding:utf8-*-
import os,sys,re
def read():
os.chdir('/etc/openvpn/sn10001/etc/')
files = open('server.conf','r').readlines()
b = [i.strip() for i in files]
for n in b:
if re.match('^server',n):
vip = re.search('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}',n).group()
#-*-coding:utf8-*-
import os,sys,re
def read():
os.chdir('/etc/openvpn/sn10001/etc/')
files = open('server.conf','r').readlines()
b = [i.strip() for i in files]
for n in b:
if re.match('^server',n):
vip = re.search('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}',n).group()
print vip
if __name__ == "__main__":
read()