mirror of
https://github.com/jimeh/skyhook.git
synced 2026-02-19 11:06:38 +00:00
initial import
This commit is contained in:
18
init/lib/skyhook/utils.rb
Normal file
18
init/lib/skyhook/utils.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
# utility methods
|
||||
def shell(*args)
|
||||
if $debug.nil? || $debug > 1
|
||||
send(:system, *args)
|
||||
else
|
||||
puts "DEBUG: " + args.join(" ")
|
||||
end
|
||||
end
|
||||
|
||||
def write_status(status)
|
||||
case status
|
||||
when 1
|
||||
shell "echo '1' > #{$status_file}"
|
||||
when 0
|
||||
shell "rm #{$status_file}"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user