Last change
on this file since a306b8b was
445497f,
checked in by Alvaro Neira Ayuso <alvaroneay@…>, 5 years ago
|
Avoid a broken pipe error on opengnsys
|
-
Property mode set to
100644
|
File size:
495 bytes
|
Rev | Line | |
---|
[29fe301] | 1 | from src.ogClient import *
|
---|
| 2 | from src.ogConfig import *
|
---|
[445497f] | 3 | from signal import signal, SIGPIPE, SIG_DFL
|
---|
[29fe301] | 4 |
|
---|
| 5 | def main():
|
---|
[445497f] | 6 | signal(SIGPIPE, SIG_DFL)
|
---|
[29fe301] | 7 | ogconfig = ogConfig()
|
---|
| 8 | if (not ogconfig.parserFile('cfg/ogagent.cfg')):
|
---|
[7548870] | 9 | print ('Error: Parsing configuration file')
|
---|
[29fe301] | 10 | return 0
|
---|
| 11 |
|
---|
| 12 | ip = ogconfig.getValueSection('opengnsys', 'ip')
|
---|
| 13 | port = ogconfig.getValueSection('opengnsys', 'port')
|
---|
| 14 |
|
---|
| 15 | client = ogClient(ip, int(port))
|
---|
| 16 | client.connect()
|
---|
[9eabc7f] | 17 | client.run()
|
---|
[29fe301] | 18 |
|
---|
| 19 | if __name__ == "__main__":
|
---|
| 20 | main()
|
---|
Note: See
TracBrowser
for help on using the repository browser.