Sha256: 40c62fc4a5feb5dbd7721f8af386e7ddf3524e3fa41af8c4f56ed6261c696f1e

Contents?: true

Size: 1.17 KB

Versions: 32

Compression:

Stored size: 1.17 KB

Contents

require "thor"
require 'sqlite3'
require "dns_one"
require "dns_one/setup"

class DnsOne::CLI < Thor  

    default_task :run_srv

    # RUN

    desc "run", "run server"
    option :conf
    option :work_dir
    def run_srv
        DnsOne::DnsOne.new(
            conf_file: options[:conf], 
            work_dir: options[:work_dir]
        ).start 
    end

    # INSTALL

    desc "install", "install dns_one"
    def install
        DnsOne::Setup.new.install
    end

    desc "uninstall", "uninstall dns_one"
    def uninstall
        DnsOne::Setup.new.uninstall
    end

    # MANAGE

    desc "start", "start dns_one"
    def start
        DnsOne::Util.ensure_sytemd
        DnsOne::Util.run "systemctl start #{DnsOne::Setup::SERVICE_NAME}"
    end

    desc "stop", "stop dns_one"
    def stop
        DnsOne::Util.ensure_sytemd
        DnsOne::Util.run "systemctl stop #{DnsOne::Setup::SERVICE_NAME}"
    end

    desc "status", "check dns_one status"
    def status
        DnsOne::Util.ensure_sytemd
        DnsOne::Util.run "systemctl status #{DnsOne::Setup::SERVICE_NAME}"
    end

    # STATS

    desc "stats", "show counters"
    def stats
        DnsOne::Stat.print
    end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
dns_one-0.5.5 lib/dns_one/cli.rb
dns_one-0.5.4 lib/dns_one/cli.rb
dns_one-0.5.3 lib/dns_one/cli.rb
dns_one-0.5.2 lib/dns_one/cli.rb
dns_one-0.5.1 lib/dns_one/cli.rb
dns_one-0.5.0 lib/dns_one/cli.rb
dns_one-0.4.66 lib/dns_one/cli.rb
dns_one-0.4.666 lib/dns_one/cli.rb
dns_one-0.4.65 lib/dns_one/cli.rb
dns_one-0.4.64 lib/dns_one/cli.rb
dns_one-0.4.63 lib/dns_one/cli.rb
dns_one-0.4.62 lib/dns_one/cli.rb
dns_one-0.4.61 lib/dns_one/cli.rb
dns_one-0.4.60 lib/dns_one/cli.rb
dns_one-0.4.59 lib/dns_one/cli.rb
dns_one-0.4.58 lib/dns_one/cli.rb
dns_one-0.4.57 lib/dns_one/cli.rb
dns_one-0.4.56 lib/dns_one/cli.rb
dns_one-0.4.55 lib/dns_one/cli.rb
dns_one-0.4.54 lib/dns_one/cli.rb