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