added frappy to servercfg
This commit is contained in:
11
router.py
11
router.py
@ -1,11 +1,12 @@
|
|||||||
import sys
|
import os
|
||||||
import socket
|
import socket
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from select import select
|
from select import select
|
||||||
from serial import serial_for_url
|
from serial import serial_for_url
|
||||||
from subprocess import Popen, PIPE, check_output, call
|
from subprocess import Popen, PIPE, check_output, call, DEVNULL
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
|
|
||||||
FILTER = "iptables -i enp4s0 -p tcp -m tcp --dport %d -j ACCEPT"
|
FILTER = "iptables -i enp4s0 -p tcp -m tcp --dport %d -j ACCEPT"
|
||||||
|
|
||||||
BASIC = """
|
BASIC = """
|
||||||
@ -198,4 +199,10 @@ if __name__ == '__main__':
|
|||||||
if len(cfgfiles) != 1:
|
if len(cfgfiles) != 1:
|
||||||
raise ValueError('there must be one and only one single cfgfile %r' % cfgfiles)
|
raise ValueError('there must be one and only one single cfgfile %r' % cfgfiles)
|
||||||
parser.read(cfgfiles[0])
|
parser.read(cfgfiles[0])
|
||||||
|
if parser.has_section('FRAPPY'):
|
||||||
|
port = parser.get('FRAPPY', 'port')
|
||||||
|
cfg = parser.get('FRAPPY', 'cfg')
|
||||||
|
cmd = ['su', '-', 'l_samenv', '-c', '/home/l_samenv/frappy/bin/secop-server -p %s %s' % (port, cfg)]
|
||||||
|
Popen(cmd, stdout=DEVNULL, stderr=DEVNULL)
|
||||||
|
if parser.has_section('ROUTER'):
|
||||||
AcceptHandler.run(parser['ROUTER'])
|
AcceptHandler.run(parser['ROUTER'])
|
||||||
|
@ -5,6 +5,7 @@ enp3s0=192.168.2.3/24
|
|||||||
enp4s0=192.168.2.4/24
|
enp4s0=192.168.2.4/24
|
||||||
|
|
||||||
[ROUTER]
|
[ROUTER]
|
||||||
3000=/dev/ttyUSB0
|
|
||||||
5900=192.168.2.33
|
[FRAPPY]
|
||||||
8080=192.168.127.254:80
|
cfg=uniax
|
||||||
|
port=5000
|
||||||
|
Reference in New Issue
Block a user