Ejemplo n.º 1
0
        public ActionResult Ping(int id, string clientId, bool active)
        {
            if (active)
            {
                SystemUpdaterCollection.Active(id, clientId);
            }
            else
            {
                var config = SysUpdateHelper.GetSystemConfig(id);

                SystemUpdaterCollection.Inactive(id, clientId, config.PingInterval);
            }

            var file = SysUpdateHelper.GetClientCommandFile(id, clientId);

            if (!System.IO.File.Exists(file))
            {
                return(Content(string.Empty));
            }
            else
            {
                var cmd = System.IO.File.ReadAllText(file);

                IOHelper.DeleteFile(file);

                return(Content(cmd, "application/octet-stream"));
            }
        }