Sha256: 34f18401d03a0aa811bb97680a074334d189732801a7403d335c1ac50258aade

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 KB

Contents

require "thor"

require "dns_one"
require "dns_one/setup"

class DnsOne::CLI < Thor  

    # RUN

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

    # 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
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dns_one-0.4.23 lib/dns_one/cli.rb
dns_one-0.4.22 lib/dns_one/cli.rb
dns_one-0.4.21 lib/dns_one/cli.rb
dns_one-0.4.20 lib/dns_one/cli.rb
dns_one-0.4.19 lib/dns_one/cli.rb
dns_one-0.4.18 lib/dns_one/cli.rb
dns_one-0.4.17 lib/dns_one/cli.rb
dns_one-0.4.16 lib/dns_one/cli.rb
dns_one-0.4.15 lib/dns_one/cli.rb
dns_one-0.4.14 lib/dns_one/cli.rb
dns_one-0.4.13 lib/dns_one/cli.rb
dns_one-0.4.12 lib/dns_one/cli.rb
dns_one-0.4.11 lib/dns_one/cli.rb
dns_one-0.4.10 lib/dns_one/cli.rb
dns_one-0.4.8 lib/dns_one/cli.rb