PlanTempusAdmin/Pages/Setup/Scripts.cshtml.cs
Janus C. H. Knudsen 77d35ff965 Initial commit
2026-02-03 00:17:08 +01:00

28 lines
715 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
namespace PlanTempusAdmin.Pages.Setup;
public class ScriptsModel : PageModel
{
private readonly IWebHostEnvironment _environment;
public string BashScript { get; set; } = string.Empty;
public ScriptsModel(IWebHostEnvironment environment)
{
_environment = environment;
}
public void OnGet()
{
var scriptPath = Path.Combine(_environment.ContentRootPath, "Scripts", "forgejo-backup.sh");
if (System.IO.File.Exists(scriptPath))
{
BashScript = System.IO.File.ReadAllText(scriptPath);
}
else
{
BashScript = "# Script not found at: " + scriptPath;
}
}
}