feature #1370: add status and restart to novnc script

This commit is contained in:
Javi Fontan committed 2013-03-05 16:12:37 +01:00
1 parent f4a51bd012
commit 2a8ee786da
2 files changed
+20 -1

No files matched your search

+10
View File
@@ -182,6 +182,16 @@ class OpenNebulaVNC
true
end
def status
if is_running?
STDOUT.puts "novnc is running"
true
else
STDOUT.puts "novnc is NOT running"
false
end
end
private
def error(code, msg)
+10 -1
View File
@@ -69,9 +69,18 @@ if ARGV[0]
vnc.start
when :stop
vnc.stop(ARGV[1]=='--force')
when :restart
vnc.stop
sleep 1
vnc.start
when :status
vnc.status
end
exit(-1) if !res
if !res
STDERR.puts "Error, check #{VNC_LOG}"
exit(-1)
end
else
exit(-1)
end