hbbs

bbs.hlirc.net
Log | Files | Refs | README | LICENSE

commit dce550f4a61473facc61fa23617b6e0bcdccf5a8
parent 52c9f83f5e727e0daa47f671eb5da8761944dd91
Author: hhvn <hayden@haydenvh.com>
Date:   Mon,  1 Feb 2021 00:39:11 +0000

hbbs.sh bin/finger.sh: add finger support

Diffstat:
Abin/finger.sh | 15+++++++++++++++
Mhbbs.sh | 2+-
2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/bin/finger.sh b/bin/finger.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. $cwd/include/userinfo.sh + +finger(){ + user=$(head -n 1 | tr -d '\r') + [ ! -f $datadir/users/$user ] && error "no such user" && return + + echo "Created: $(userget "$user" creation)" + echo "Email: $(userget "$user" email)" + [ "$(userget "$user" nick)" != "" ] && echo "Nick: $(userget "$user" nick)" + echo + cat $datadir/profile/$user + tput sgr0 +} diff --git a/hbbs.sh b/hbbs.sh @@ -10,7 +10,7 @@ mkdir $datadir -p || die "cannot write to data dir" touch $datadir/.test || die "cannot write to data dir" mkdir -p $datadir/profile $datadir/boards $datadir/users $(for b in $(echo "$boards" | tr '[:upper:]' '[:lower:]'); do echo $datadir/boards/$b; done) -[ "$1" = "-f" ] && cat | bin finger +[ "$1" = "-f" ] && bin finger && exit 1 info "Setting terminal to $term" export TERM="$term"