command 'frappy cli' does now connect to the configured frappy
and not scanned frappy servers
This commit is contained in:
@@ -130,11 +130,12 @@ WantedBy = multi-user.target
|
||||
|
||||
FRAPPY_SERVICE = """[Unit]
|
||||
Description = Running frappy server
|
||||
After=waitboot.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=PYTHONPATH=/home/l_samenv/.local/lib/python3.11/site-packages/
|
||||
ExecStart = /home/l_samenv/boxtools/start_frappy 10
|
||||
ExecStart = /home/l_samenv/boxtools/start_frappy
|
||||
|
||||
[Install]
|
||||
WantedBy = default.target
|
||||
|
||||
13
start_frappy
13
start_frappy
@@ -5,6 +5,7 @@ import time
|
||||
from frappy.lib import generalConfig
|
||||
from frappy.logging import logger
|
||||
from frappy.server import Server
|
||||
from frappy.client.interactive import init, interact
|
||||
from utils import BoxInfo
|
||||
|
||||
box = BoxInfo()
|
||||
@@ -15,9 +16,15 @@ def main(cfg, port=None, **_):
|
||||
srv = Server(cfg, logger.log, cfgfiles=None, interface=port)
|
||||
srv.run()
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
time.sleep(int(sys.argv[1]))
|
||||
def cli(cfg, port, **_):
|
||||
init(f'localhost:{port}')
|
||||
interact()
|
||||
|
||||
main(**box.read_config('FRAPPY'))
|
||||
cfg = box.read_config('FRAPPY')
|
||||
|
||||
if sys.argv[1:2] == ['cli']:
|
||||
cli(**cfg)
|
||||
else:
|
||||
main(**cfg)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ frappy() {
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: frappy status|start|stop|restart|cli"
|
||||
elif [[ "$1" == "cli" ]]; then
|
||||
~/frappy/bin/frappy-cli
|
||||
~/boxtools/start_frappy cli
|
||||
else
|
||||
systemctl --user $1 frappy
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user