Module: Unix::Exec
Instance Method Summary collapse
Methods included from Beaker::CommandFactory
Instance Method Details
#echo(msg, abs = true) ⇒ Object
4 5 6 |
# File 'lib/beaker/host/unix/exec.rb', line 4 def echo(msg, abs=true) (abs ? '/bin/echo' : 'echo') + " #{msg}" end |
#get_ip ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/beaker/host/unix/exec.rb', line 16 def get_ip if self['platform'].include? 'solaris' execute("ifconfig -a inet| awk '/broadcast/ {print $2}' | cut -d/ -f1 | head -1").strip else execute("ip a|awk '/global/{print$2}' | cut -d/ -f1 | head -1").strip end end |
#path ⇒ Object
12 13 14 |
# File 'lib/beaker/host/unix/exec.rb', line 12 def path '/bin:/usr/bin' end |
#touch(file, abs = true) ⇒ Object
8 9 10 |
# File 'lib/beaker/host/unix/exec.rb', line 8 def touch(file, abs=true) (abs ? '/bin/touch' : 'touch') + " #{file}" end |