Add more filetype support. - gopher-lawn - The gopher lawn gopher directory project.
(HTM) git clone git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-lawn/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
---
(DIR) commit 80a5e9f6b263f8c9802600c0bc6cf11e2f34d7d4
(DIR) parent 5dc5fccad94a7b9c5c9fb48d1f52003d5b8833ef
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 12 Aug 2023 18:44:19 +0200
Add more filetype support.
Diffstat:
M mk-pearls | 32 ++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/mk-pearls b/mk-pearls
@@ -13,10 +13,30 @@
| cut -d':' -f2- | xargs)"
case "${line}" in
Type:*)
- if [ "${fieldval}" != "text" ];
- then
- break;
- fi
+ gtype="9"
+ case "${fieldval}" in
+ link)
+ gtype="1"
+ ;;
+ text)
+ gtype="0"
+ ;;
+ cso)
+ gtype="2"
+ ;;
+ error)
+ gtype="3"
+ ;;
+ uuencoded)
+ gtype="6"
+ ;;
+ search)
+ gtype="7"
+ ;;
+ telnet)
+ gtype="8"
+ ;;
+ esac
;;
Selector:*)
selector="${fieldval}"
@@ -37,9 +57,11 @@
if [ -n "${selector}" ] \
&& [ -n "${host}" ] \
&& [ -n "${port}" ] \
+ && [ -n "${gtype}" ] \
&& [ -n "${linkname}" ];
then
- printf "[0| (_) %s|%s|%s|%s]\n" \
+ printf "[%s| (_) %s|%s|%s|%s]\n" \
+ "$gtype" \
"${linkname}" \
"${selector}" \
"${host}" \