mirror of
https://github.com/gryf/ferrit.git
synced 2026-02-07 08:45:53 +01:00
Add parameters for the service
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import multiprocessing
|
||||
import os
|
||||
import tempfile
|
||||
@@ -8,6 +9,24 @@ from ferrit import rest
|
||||
|
||||
|
||||
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.')
|
||||
os.close(fd)
|
||||
os.unlink(fifo)
|
||||
|
||||
Reference in New Issue
Block a user