Sha256: aebacf48b82b0238b0ec2095dcc1ebbddce111dbe3b8058f9a0b8109667b91b2

Contents?: true

Size: 532 Bytes

Versions: 31

Compression:

Stored size: 532 Bytes

Contents

module Veewee
  module Provider
    module Core
      module BoxCommand

        def sudo(scriptname)
          if definition.ssh_user=="root"
            return "#{scriptname}"
          else
            command=definition.sudo_cmd
            newcommand=command.gsub(/%p/,"#{definition.ssh_password}")
            newcommand.gsub!(/%u/,"#{definition.ssh_user}")
            newcommand.gsub!(/%f/,"#{scriptname}")
            return newcommand
          end
        end

      end #Module
    end #Module
  end #Module
end #Module

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
veewee-0.3.4 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.3 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.2 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.1 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.beta2 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.beta1 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.alpha9 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.alpha8 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.alpha7 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.alpha6 lib/veewee/provider/core/box/sudo.rb
veewee-0.3.0.alpha5 lib/veewee/provider/core/box/sudo.rb