Example #1
0
        /// <summary>
        /// 03 - se c'รจ spazio libero scarica i file del Kernel
        ///     li scarica in una cartella tmp e poi li sposta in /mnt/cdrom/Kernel
        ///     - active-firmware
        ///     - active-initrd
        ///     - active-kernel
        ///     - active-modules
        /// 04 - e in /mnt/cdrom/System
        ///     - active-system
        /// </summary>
        public void DownloadNewFiles()
        {
            var firmwareTmp = $"/tmp/firmare";

            ApiConsumer.GetFile("/url/download/firmware", $"{firmwareTmp}");
            var initrdTmp = $"/tmp/initrd";

            ApiConsumer.GetFile("/url/download/initrd", $"{initrdTmp}");
            var kernelTmp = $"/tmp/kernel";

            ApiConsumer.GetFile("/url/download/kernel", $"{kernelTmp}");
            var modulesTmp = $"/tmp/modules";

            ApiConsumer.GetFile("/url/download/modules", $"{modulesTmp}");
            var systemTmp = $"/tmp/system";

            ApiConsumer.GetFile("/url/download/system", $"{systemTmp}");

            Bash.Execute($"cp {firmwareTmp} {Parameter.RepoKernel}");
            Bash.Execute($"cp {initrdTmp} {Parameter.RepoKernel}");
            Bash.Execute($"cp {kernelTmp} {Parameter.RepoKernel}");
            Bash.Execute($"cp {modulesTmp} {Parameter.RepoKernel}");
            Bash.Execute($"cp {systemTmp} {Parameter.RepoSystem}");

            Bash.Execute($"rm {Parameter.RepoKernel}/active-firmware");
            Bash.Execute($"rm {Parameter.RepoKernel}/active-initrd");
            Bash.Execute($"rm {Parameter.RepoKernel}/active-kernel");
            Bash.Execute($"rm {Parameter.RepoKernel}/active-modules");
            Bash.Execute($"rm {Parameter.RepoSystem}/active-system");

            Bash.Execute($"ln -s {Parameter.RepoKernel}/firmware {Parameter.RepoKernel}/active-firmware");
            Bash.Execute($"ln -s {Parameter.RepoKernel}/initrd {Parameter.RepoKernel}/active-initrd");
            Bash.Execute($"ln -s {Parameter.RepoKernel}/kernel {Parameter.RepoKernel}/active-kernel");
            Bash.Execute($"ln -s {Parameter.RepoKernel}/modules {Parameter.RepoKernel}/active-modules");
            Bash.Execute($"ln -s {Parameter.RepoSystem}/system {Parameter.RepoSystem}/active-system");
        }