separate config file
This commit is contained in:
parent
2670f1e1e9
commit
6ad410339c
3 changed files with 15 additions and 5 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
config.sh
|
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PUBIF=ens18
|
. /root/frankenrouter/config.sh
|
||||||
TRANSPORT_IP="87.120.110.252/24"
|
|
||||||
TRANSPORT_GW="87.120.110.1"
|
|
||||||
|
|
||||||
mkdir -p /root/fr-vlanconf
|
mkdir -p /root/fr-vlanconf
|
||||||
mkdir -p /root/fr-workscripts
|
mkdir -p /root/fr-workscripts
|
||||||
|
|
|
@ -3,10 +3,21 @@
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
slave_name = 'lexx'
|
conffile = open('/root/frankenrouter/config.sh', 'r')
|
||||||
|
for line in conffile:
|
||||||
|
if re.search('LABEL', line):
|
||||||
|
slave_name = line.split('=', 1)[1].rstrip().replace('"', '')
|
||||||
|
conffile.close()
|
||||||
|
|
||||||
api_url = 'https://www.datapoint.bg/vmanager/slavetables'
|
conffile = open('/root/frankenrouter/config.sh', 'r')
|
||||||
|
for line in conffile:
|
||||||
|
if re.search('APIHOST', line):
|
||||||
|
api_host = line.split('=', 1)[1].rstrip().replace('"', '')
|
||||||
|
conffile.close()
|
||||||
|
|
||||||
|
api_url = 'https://' + str(api_host) + '/vmanager/slavetables'
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue