add delay as argument to start_frappy
This commit is contained in:
@ -6,5 +6,4 @@ MAC=b8:27:eb:33:2e:7a
|
||||
version=1
|
||||
|
||||
[FRAPPY]
|
||||
port=5000
|
||||
cfg=fs
|
||||
|
@ -132,7 +132,7 @@ Description = Running frappy server
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=PYTHONPATH=/home/l_samenv/.local/lib/python3.11/site-packages/
|
||||
ExecStart = /home/l_samenv/boxtools/start_frappy
|
||||
ExecStart = /home/l_samenv/boxtools/start_frappy 10
|
||||
|
||||
[Install]
|
||||
WantedBy = default.target
|
||||
|
18
start_frappy
18
start_frappy
@ -1,18 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
from pathlib import Path
|
||||
from utils import BoxInfo
|
||||
|
||||
box = BoxInfo()
|
||||
|
||||
def start_frappy(cfg, port=None):
|
||||
# os.chdir(Path('~/frappy').expanduser())
|
||||
if port is None:
|
||||
portarg = ''
|
||||
else:
|
||||
portarg = f'-p {port} '
|
||||
os.system(f"{str(Path('~').expanduser() / 'frappy/bin/frappy-server')} {portarg}{cfg}")
|
||||
cmd = ['/home/l_samenv/frappy/bin/frappy-server']
|
||||
if port:
|
||||
cmd.append('-p')
|
||||
cmd.append(str(port))
|
||||
cmd.append(cfg)
|
||||
os.system(' '.join(cmd))
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
time.sleep(int(sys.argv[1]))
|
||||
|
||||
time.sleep(10)
|
||||
start_frappy(**box.read_config('FRAPPY'))
|
||||
|
Reference in New Issue
Block a user