Tighting up search script, updating system info. - gopherhole - My gopherhole source code.
HTML git clone git://jay.scot/gopherhole
DIR Log
DIR Files
DIR Refs
---
DIR commit 864e151a1fb226ec350ee9b6556ff3504732c59e
DIR parent 6ba5831af8364bbeb721c9a7504871a7e5b425a5
HTML Author: Jay Scott <me@jay.scot>
Date: Thu, 11 Dec 2025 11:29:48 +0000
Tighting up search script, updating system info.
Diffstat:
A meta/openbsd-logo.txt | 7 +++++++
M meta/search.sh | 6 ++++++
M meta/system.cgi | 31 +++++++++++++++++--------------
3 files changed, 30 insertions(+), 14 deletions(-)
---
DIR diff --git a/meta/openbsd-logo.txt b/meta/openbsd-logo.txt
@@ -0,0 +1,7 @@
+ _____
+ \- -/
+ \_/ \
+ | O O |
+ |_ < ) 3 )
+ / \ /
+ /-_____-\
DIR diff --git a/meta/search.sh b/meta/search.sh
@@ -10,6 +10,12 @@ root="/home/jay/gopher"
content="phlog/txt/*.txt"
keyword="$1"
+if echo "$keyword" | grep -q '[$;<>`|]'; then
+ printf "Haha your at it mate, calm doon with the pish characters.\n"
+ printf "Trying shell escape in like its 1990.. I guess you are on gopher.\n"
+ return 0
+fi
+
for file in $root/$content; do
if [ -f "$file" ]; then
if grep -iq "$keyword" "$file"; then
DIR diff --git a/meta/system.cgi b/meta/system.cgi
@@ -4,19 +4,22 @@ hostname=$(hostname)
uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
load=$(uptime | awk -F'[a-z]:' '{print $2}')
os=$(uname -rsm)
+packages="$(pkg_info -a | wc -l | sed 's/ //g')"
-printf "
-[jay.scot]
-[SERVER]
-\n\n
-This gopherhole is currently hosted at OpenBSD Amsterdam. I would love
-to host this locally on a raspberry Pi or similar but I live in rural
-Scotland where my internet can be very temperamental. The current host
-also donates €15 per VM to the OpenBSD project which is a great touch.
-\n\n"
+printf "[jay.scot]\n[SERVER]\n\n"
-printf "\tserver hostname : %s\n" "$hostname"
-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\n\n" "$load"
+cat ./openbsd-logo.txt
+
+printf "\n
+This gopherhole is currently at OpenBSD Amsterdam. I would love to host
+this locally on a raspberry Pi or similar but I live in rural Scotland
+where my internet can be very temperamental. The current host also
+donates €15 per VM to the OpenBSD project which is a great touch."
+
+printf "\n\n\n"
+printf "\tserver hostname : %s\n" "$hostname"
+printf "\toperating system : %s\n" "$os"
+printf "\tinstalled packages : %s\n" "$packages"
+printf "\tserver software : geomyidae, git, git-daemon\n"
+printf "\tsystem uptime : %s\n" "$uptime"
+printf "\tload average :%s\n\n\n" "$load"