Exemple #1
0
        public bool Update_ConfigXML(FileInfo fileinfo)
        {
            bool retVal = false;

            if (!disposed)
            {
                string newfile = "/conf/temp.xml";
                if (_client.UploadFile(fileinfo, newfile))
                {
                    string sSize = _client.GetCommandResponse(String.Format("du -k {0} | awk '{{print $1}}'", newfile));
                    try
                    {
                        double dsize = double.Parse(sSize);
                        if (dsize > 0d)
                        {
                            _client.GetCommandRawResponse(String.Format("cp -f {0} /conf/config.xml", newfile));
                            _client.GetCommandRawResponse(String.Format("rm -f {0}", newfile));
                            retVal = true;
                        }
                    }
                    catch { }
                }
            }
            return(retVal);
        }