cosmic-backup/gopher/ships/ship/gophermap

20 lines
474 B
Plaintext
Raw Normal View History

2018-11-27 00:00:01 +00:00
#!/bin/sh
ship="$(/bin/pwd -L | sed 's|.*/||')"
desc="/var/gopher/${ship}/.description"
if [ -f "$desc" ]; then
cat "$desc"
printf "\\n"
fi
printf "%s - Ship Log\\n" "$ship"
2019-01-07 00:00:02 +00:00
tac "/var/gopher/listing.gophermap" | sed "s|^0||" | awk '{print 0 NR " >> " $0}' | grep "^.*>>\\ ${ship}"
2019-01-25 00:00:01 +00:00
printf "\\n\\nLicense:\\n"
lic="/var/gopher/${ship}/LICENSE"
if [ -f "$lic" ]; then
printf "0%s\\t/%s/LICENSE" "$(head -n 1 "$lic")" "$ship"
else
printf "All rights reserved.\\n"
fi