mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
refactor
This commit is contained in:
35
tile-gen.py
Normal file
35
tile-gen.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import click
|
||||
|
||||
from ssh_lib.cli_helpers import common_options, get_connection
|
||||
from ssh_lib.tasks_shared import prepare_shared
|
||||
from ssh_lib.tasks_tile_gen import prepare_tile_gen
|
||||
|
||||
|
||||
@click.group()
|
||||
def cli():
|
||||
pass
|
||||
|
||||
|
||||
@cli.command()
|
||||
@common_options
|
||||
@click.option('--cron', is_flag=True, help='Enable cron task')
|
||||
@click.option('--reinstall', is_flag=True, help='Reinstall everything in /data/ofm folder')
|
||||
def tile_gen(
|
||||
hostname,
|
||||
user,
|
||||
port,
|
||||
noninteractive,
|
||||
#
|
||||
cron,
|
||||
reinstall,
|
||||
):
|
||||
if not noninteractive and not click.confirm(f'Run script on {hostname}?'):
|
||||
return
|
||||
|
||||
c = get_connection(hostname, user, port)
|
||||
|
||||
if reinstall:
|
||||
c.sudo('rm -rf /data/ofm')
|
||||
|
||||
prepare_shared(c)
|
||||
prepare_tile_gen(c, enable_cron=cron)
|
||||
Reference in New Issue
Block a user