Read hostname from /etc/hostname
This commit is contained in:
parent
bf4fd38202
commit
d206cad0c5
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Home Server Status</title>
|
<title><%= hostname %> status</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background: #0f1117;
|
background: #0f1117;
|
||||||
@ -115,7 +115,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1><span>homelab</span> · status</h1>
|
<h1><span><%= hostname %></span> · status</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|||||||
@ -7,6 +7,8 @@ ASSETS_DIR = File.join(__dir__, "../assets")
|
|||||||
|
|
||||||
cgi = CGI.new
|
cgi = CGI.new
|
||||||
|
|
||||||
|
hostname = File.read("/etc/hostname").strip rescue "localhost"
|
||||||
|
|
||||||
template = ERB.new(File.read(File.join(ASSETS_DIR, "login.erb")))
|
template = ERB.new(File.read(File.join(ASSETS_DIR, "login.erb")))
|
||||||
|
|
||||||
cgi.out("type" => "text/html", "charset" => "UTF-8") do
|
cgi.out("type" => "text/html", "charset" => "UTF-8") do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user