28 lines
715 B
C#
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;
|
|
}
|
|
}
|
|
}
|