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:
parent
f4a51bd012
commit
2a8ee786da
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user