Cleaning up system info script. - gopherhole - My gopherhole source code.
(HTM) git clone git://jay.scot/gopherhole
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 6eaa2a0e24f24964fa5fe0cfb2c1280a7c183b3c
(DIR) parent 9b702df62096326a67916bbb4e7d06b19e93f344
(HTM) Author: Jay Scott <me@jay.scot>
Date: Sun, 26 Jan 2025 16:14:11 +0000
Cleaning up system info script.
Diffstat:
M meta/system.cgi | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/meta/system.cgi b/meta/system.cgi
@@ -1,15 +1,18 @@
#!/bin/sh
-uptime=$(uptime)
hostname=$(hostname)
uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
-architecture=$(uname -m)
load=$(uptime | awk -F'[a-z]:' '{print $2}')
+os=$(uname -rsm)
+
+bad_ips=$(cat /home/jay/gopher/meta/bad_ips.txt)
printf "General Information:\n\n\n"
printf "\tserver hostname : %s\n" "$hostname"
-printf "\toperating system : OpenBSD 7.6\n"
-printf "\tarchitecture : %s\n" "$architecture"
+printf "\toperating system : %s\n" "$os"
printf "\tserver software : geomyidae, git, git-daemon\n"
printf "\tsystem uptime : %s\n" "$uptime"
-printf "\tload average :%s\n" "$load"
+printf "\tload average :%s\n\n\n" "$load"
+
+printf "Bad IPs (bruteforce attempts):\n\n\n"
+printf "%s\n" "$bad_ips"