mirror of
https://github.com/gryf/ferrit.git
synced 2026-02-13 12:55:46 +01:00
Add parameters for the service
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
import argparse
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -8,6 +9,24 @@ from ferrit import rest
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
key = ssh.KEY
|
||||||
|
logpath = ssh.LOG_PATH
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('-k', '--key', default=key,
|
||||||
|
help='Path to the keypair for the SSH server. Path '
|
||||||
|
'should contain private key. Default is %s' % key)
|
||||||
|
parser.add_argument('-l', '--log-path', default=logpath,
|
||||||
|
help='Path to the directory, where log for ssh and '
|
||||||
|
'http will be stored. Directory must exists. Logs '
|
||||||
|
'will be named ferrit-ssh.log and ferrit-http.log '
|
||||||
|
'restively. Logs will be appended to the files if '
|
||||||
|
'exists. Default location is current directory.')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
ssh.KEY = args.key
|
||||||
|
ssh.LOG_PATH = args.log_path
|
||||||
|
rest.LOG_PATH = args.log_path
|
||||||
|
|
||||||
fd, fifo = tempfile.mkstemp(suffix='.fifo', prefix='ferrit.')
|
fd, fifo = tempfile.mkstemp(suffix='.fifo', prefix='ferrit.')
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
os.unlink(fifo)
|
os.unlink(fifo)
|
||||||
|
|||||||
Reference in New Issue
Block a user