This commit is contained in:
Zsolt Ero
2025-10-15 16:22:53 +02:00
parent 753166316c
commit 2becae11e1
3 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import click
import json5
from ssh_lib.cli_helpers import common_options, get_connection
from ssh_lib.config import config
@@ -33,7 +32,8 @@ def init_static(hostname, user, port, noninteractive):
@cli.command()
@common_options
def init_autoupdate(hostname, user, port, noninteractive):
@click.option('--sync', is_flag=True, help='Run manual sync after init')
def init_autoupdate(hostname, user, port, noninteractive, sync):
if not noninteractive and not click.confirm(f'Run script on {hostname}?'):
return
@@ -44,8 +44,8 @@ def init_autoupdate(hostname, user, port, noninteractive):
prepare_shared(c)
prepare_http_host(c)
# for the monaco run, wait for the sync to complete
if json5.loads(config.local_config_jsonc.read_text()).get('skip_planet'):
# if --sync, run manual sync
if sync:
run_http_host_sync(c)
put(c, config.local_modules_dir / 'http_host' / 'cron.d' / 'ofm_http_host', '/etc/cron.d/')