Commit cb3f5dd2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: CLI: exit cleanly

parent e6ab18c1
...@@ -67,6 +67,8 @@ strip = common.strip ...@@ -67,6 +67,8 @@ strip = common.strip
_ = vlc.gettext._ _ = vlc.gettext._
N_ = vlc.gettext.N_ N_ = vlc.gettext.N_
running = true
--[[ Setup default environement ]] --[[ Setup default environement ]]
env = { prompt = "> "; env = { prompt = "> ";
width = 70; width = 70;
...@@ -158,6 +160,7 @@ function shutdown(name,client) ...@@ -158,6 +160,7 @@ function shutdown(name,client)
h:broadcast("Shutting down.\r\n") h:broadcast("Shutting down.\r\n")
vlc.msg.info("Requested shutdown.") vlc.msg.info("Requested shutdown.")
vlc.misc.quit() vlc.misc.quit()
running = false
end end
function quit(name,client) function quit(name,client)
...@@ -784,7 +787,7 @@ h:listen( config.hosts or config.host or "*console" ) ...@@ -784,7 +787,7 @@ h:listen( config.hosts or config.host or "*console" )
password = config.password or "admin" password = config.password or "admin"
--[[ The main loop ]] --[[ The main loop ]]
while true do while running do
local write, read = h:accept_and_select() local write, read = h:accept_and_select()
for _, client in pairs(write) do for _, client in pairs(write) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment