add efingerd config

This commit is contained in:
creme 2019-08-11 20:54:10 +02:00
parent 062da60ec2
commit bf7cd638aa
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
5 changed files with 224 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# envs.net | finger server
we use `efingerd`

71
list Executable file
View File

@ -0,0 +1,71 @@
#!/bin/sh
. /etc/efingerd/log # do some logging
echo
if [ "$1" = "vanya" ]; then # special action if vanya wants to finger us
echo "What do you want?????" # from any computer
echo "Go away"
exit 0 # and finish without telling him who is logged
fi
if [ "$1" = "jzatko" ]; then # not so special action if jzatko wants to finger us
echo "Hellooooooooooooooo"
echo
fi
if [ "$1" = "matos" ]; then # this user likes short listings
who -q
exit 0
fi
if [ "$2" = "pascal.fmph.uniba.sk" ]; then # ban the whole computer pascal
echo "Sorry, we do not want you to know who is here."
exit 0
fi
if [ "$1@$2" = "linus@transmeta.com" ]; then
# a very special occasion
# you should put here site specific action
# this here is just an example:
cat <<EOM
Unable to handle kernel paging request at virtual address c8848ffc
current->tss.cr3 = 00ff1000, %cr3 = 00ff1000
*pde = 0009e067
*pte = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<0018596b>]
EFLAGS: 00010297
eax: 08848ffc ebx: ffffffff ecx: 08848ffc edx: fffffffe
esi: ffffffff edi: 07230073 ebp: 00000000 esp: 07150ed4
ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
Process cat (pid: 526, process nr: 35, stackpage=07150000)
Stack: 00389ad8 00000062 00000007 07230000 00000000 00000061 00000004 ffffffff
0000001b 00000001 00185b14 07230062 0018641e 07150f28 0010ca43 07230062
00186410 00000007 00000001 00000020 08848ffc 00000000 07150f90 00001000
Call Trace: [<00185b14>] [<0010ca43>] [<08848ffc>] [<0015c9b6>] [<0015cc26>] [<001236e0>] [<0010a8a9>]
Code: 80 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 89 c6 f7 c5 10 00
EOM
exit 0
fi
if [ "$1" = "(null)" ]; then
echo Hello "$2", # we do not know who it is - does not run ident
else
echo Hello "$1@$2", # else greet him
fi
echo users currently logged in are:
echo
who -uHw # and display the user listing in readable form
# or:
# finger # classical alternative
# or:
# ps aux # this reveals too much - do not use this command, unless
# you trust people who finger you
echo

8
log Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# file /var/log/efingerd.log has to be writeable by UID
# efingerd runs under for this to work
#echo `date` "$3" fingered from "$1@$2" >>/var/log/efingerd.log
echo `date` "$3" fingered from "$1@$2" >>/var/log/efingerd.log

63
luser Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
. /etc/efingerd/log
echo
if [ "$1" = "(null)" ]; then
echo hello "$2",
else
echo hello "$1@$2",
fi
echo
if [ "$3" = "root" ]; then
echo "you've reached"
figlet -f smslant envs.net
cat <<EOM
envs.net is a minimalist, non-commercial
shared unix system and will always be free to use.
we are linux lovers, programmer and users who like build webpages,
write blogs, chat online, play cool console games and so much more.
you wish to join with an small user space?
https://envs.net/
https://envs.net/signup/
EOM
else
user_folder="/home/${3}"
# /usr/bin/finger -m "$3"
# Project
printf "Project:\\n"
if [ -f "${user_folder}/.project" ]; then
sed 's/^/ /' "${user_folder}/.project"
else
printf "No Project.\\n"
fi
# Plan
printf "Plan:\\n"
if [ -f "${user_folder}/.plan" ]; then
sed 's/^/ /' "${user_folder}/.plan"
else
printf "No Plan.\\n"
fi
# Timezone
if [ -f "${user_folder}/.tz" ]; then
echo -n "Timezone: "
cat "${user_folder}/.tz"
echo
fi
# Online status
if finger "$3" | grep -q 'On since'; then
printf "Online.\\n"
fi
fi

79
nouser Executable file
View File

@ -0,0 +1,79 @@
#!/bin/sh
#. /etc/efingerd/log
echo
if [ "$1" = "(null)" ]; then
echo hello "$2",
else
echo hello "$1@$2",
fi
if [ "$3" = "time" ]; then
echo The time is...
date
exit 0
fi
if [ "$3" = "envs" ]; then
echo envs 4 a live
exit 0
fi
if [ "$3" = "tilde" ]; then
echo a tilde 4 u a tilde 4 me
exit 0
fi
if [ "$3" = "ping" ]; then
echo "PONG!"
ping -c 5 "$2"
exit 0
fi
if [ "$3" = "fortune" ]; then
/usr/games/fortune
exit 0
fi
if [ "$3" = "uptime" ]; then
/usr/bin/uptime
exit 0
fi
if [ "$3" = "uname" ]; then
/bin/uname --all
exit 0
fi
if [ "$3" = "new" ]; then
echo visit https://envs.net/signup/ to request an account
exit 0
fi
if [ "$3" = "signup" ]; then
echo https://envs.net/signup/
exit 0
fi
if [ "$3" = "gopher" ]; then
echo try port 70
exit 0
fi
echo "you've reached"
figlet -f smslant envs.net
cat <<EOM
envs.net is a minimalist, non-commercial
shared unix system and will always be free to use.
we are linux lovers, sysadmins, programmer and users who like build
webpages, write blogs, chat online, play cool console games and so much
more. you wish to join with an small user space?
join the team today!
https://envs.net/signup/
https://envs.net/
EOM