Sha256: 055eeee80cb4daf2712d11cae1bb78abd223d575ca528a155e5c9be8c3da042e

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

module Perus::Pinger
    class KillProcess < Command
        description 'Kills all instances of a process. Valid values for
                     "process_name" are contained in the pinger config file.'
        option :process_name, restricted: true
        option :signal, default: 'KILL'

        def run
            result = `killall -#{option.signal} #{option.process_name}`
            result.include?('no process found') ? result : true
        end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
perus-0.1.2 lib/perus/pinger/commands/kill_process.rb
perus-0.1.1 lib/perus/pinger/commands/kill_process.rb
perus-0.1.0 lib/perus/pinger/commands/kill_process.rb