1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2012 - DIGITEO - Simon GARESTE <simon.gareste@scilab.org>
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
13 // Restore the config file using the config.bak file
15 function atomsRestoreConfig(quiet)
20 error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"), "atomsSaveConfig", 0, 1));
23 load("SCI/modules/atoms/macros/atoms_internals/lib");
29 proxy_attrs = ["enabled", "host", "port", "user", "password"];
30 xmlSetValues("//web/body/proxy", [proxy_attrs ; xmlGetValues("//web/body/previous-proxy", proxy_attrs)]);
32 pathsystemuser = atomsPath("system", "user");
34 if isfile(pathsystemuser + "config.bak") then
35 movefile(pathsystemuser + "config.bak", pathsystemuser + "config");
37 error(msprintf(gettext("File %s does not exist: could not restore previous configuration."), pathsystemuser + "config.bak"));