separate config file

This commit is contained in:
deflax 2018-02-23 07:17:21 -05:00
parent 2670f1e1e9
commit 6ad410339c
3 changed files with 15 additions and 5 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
config.sh

View file

@ -1,8 +1,6 @@
#!/bin/bash
PUBIF=ens18
TRANSPORT_IP="87.120.110.252/24"
TRANSPORT_GW="87.120.110.1"
. /root/frankenrouter/config.sh
mkdir -p /root/fr-vlanconf
mkdir -p /root/fr-workscripts

View file

@ -3,10 +3,21 @@
import requests
import json
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'
###