1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-12 21:57:23 +03:00

feature #1370: add status and restart to novnc script

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

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)

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