mirror of https://git.envs.net/envs/finger.git
fix finger
This commit is contained in:
parent
b35e732c5f
commit
f5f2282046
73
list
73
list
|
@ -2,70 +2,19 @@
|
|||
|
||||
. /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
|
||||
|
||||
printf "\nwelcome to\n"
|
||||
figlet -f smslant envs.net
|
||||
printf "is a minimalist, non-commercial\nshared unix system and will always be free to use.\n\n"
|
||||
printf "we are linux lovers, programmer and users who like build webpages,\n"
|
||||
printf "write blogs, chat online, play cool console games and so much more.\n"
|
||||
printf "visit us on the web or gopher for more info\n"
|
||||
|
||||
if [ "$1" = "(null)" ]; then
|
||||
echo Hello "$2", # we do not know who it is - does not run ident
|
||||
printf "hello %s,\n" "$2"
|
||||
else
|
||||
echo Hello "$1@$2", # else greet him
|
||||
printf "hello %s@%s\n" "$1" "$2"
|
||||
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
|
||||
printf "users currently logged in are:\n\n"
|
||||
who -uw | sort -u -k 1,1
|
||||
printf "\n"
|
||||
|
|
10
luser
10
luser
|
@ -2,13 +2,11 @@
|
|||
|
||||
. /etc/efingerd/log
|
||||
|
||||
echo
|
||||
if [ "$1" = "(null)" ]; then
|
||||
echo hello "$2",
|
||||
printf "\nhello %s,\n\n" "$2"
|
||||
else
|
||||
echo hello "$1@$2",
|
||||
printf "\nhello %s@%s\n\n" "$1" "$2"
|
||||
fi
|
||||
echo
|
||||
|
||||
if [ "$3" = "root" ]; then
|
||||
|
||||
|
@ -50,9 +48,9 @@ else
|
|||
|
||||
# Timezone
|
||||
if [ -f "${user_folder}/.tz" ]; then
|
||||
echo -n "Timezone: "
|
||||
printf "Timezone: "
|
||||
cat "${user_folder}/.tz"
|
||||
echo
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
# Online status
|
||||
|
|
22
nouser
22
nouser
|
@ -2,31 +2,31 @@
|
|||
|
||||
#. /etc/efingerd/log
|
||||
|
||||
echo
|
||||
if [ "$1" = "(null)" ]; then
|
||||
echo hello "$2",
|
||||
printf "hello %s,\n" "$2"
|
||||
else
|
||||
echo hello "$1@$2",
|
||||
printf "hello %s@%s\n" "$1" "$2"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$3" = "time" ]; then
|
||||
echo The time is...
|
||||
printf 'The time is...\n'
|
||||
date
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$3" = "envs" ]; then
|
||||
echo envs 4 a live
|
||||
printf "envs 4 a live\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$3" = "tilde" ]; then
|
||||
echo a tilde 4 u a tilde 4 me
|
||||
printf "a tilde 4 u a tilde 4 me\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$3" = "ping" ]; then
|
||||
echo "PONG!"
|
||||
printf "PONG!\n"
|
||||
ping -c 5 "$2"
|
||||
exit 0
|
||||
fi
|
||||
|
@ -47,21 +47,21 @@ if [ "$3" = "uname" ]; then
|
|||
fi
|
||||
|
||||
if [ "$3" = "new" ]; then
|
||||
echo visit https://envs.net/signup/ to request an account
|
||||
printf "visit https://envs.net/signup/ to request an account\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$3" = "signup" ]; then
|
||||
echo https://envs.net/signup/
|
||||
printf "https://envs.net/signup/\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$3" = "gopher" ]; then
|
||||
echo try port 70
|
||||
printf "try port 70\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "you've reached"
|
||||
printf "you've reached\n"
|
||||
figlet -f smslant envs.net
|
||||
|
||||
cat <<EOM
|
||||
|
|
Loading…
Reference in New Issue