2024-04-12 18:50:55 +00:00
|
|
|
#!/bin/sh -e
|
2024-02-09 20:13:25 +00:00
|
|
|
|
|
|
|
# make username uppercase
|
|
|
|
username=$(echo "$USER" | tr '[:lower:]' '[:upper:]')
|
2024-04-12 18:50:55 +00:00
|
|
|
timezone=UTC
|
|
|
|
chatlog=/var/log/bunkchat/chat.log
|
|
|
|
prompt=""
|
2024-02-09 20:13:25 +00:00
|
|
|
|
|
|
|
makeSlug () {
|
2024-04-12 18:50:55 +00:00
|
|
|
# make time and date
|
|
|
|
time=$(TZ=${timezone} date +%I:%M%p)
|
|
|
|
date=$(TZ=${timezone} date +%m/%d)
|
2024-02-09 20:13:25 +00:00
|
|
|
|
2024-04-12 18:50:55 +00:00
|
|
|
# make name/time string
|
|
|
|
prompt="${username}-${date}-${time}"
|
2024-02-09 20:13:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# enter bunkchat mode (clear the screen)
|
|
|
|
clear
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
2024-04-12 18:50:55 +00:00
|
|
|
echo "┏━┓┏━┓┏━┓┏━╸╻ ┏━┓╻┏┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸"
|
|
|
|
echo "┣━┛┣┳┛┃ ┃┃ ┃ ┣━┫┃┃┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ "
|
|
|
|
echo "╹ ╹┗╸┗━┛┗━╸┗━╸╹ ╹╹╹ ╹ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ "
|
2024-04-13 23:39:57 +00:00
|
|
|
echo "Proclaim your musings, $USER! This is a group chat with everyone on the server!"
|
2024-04-13 23:36:15 +00:00
|
|
|
echo "You may view current chat with 'heed'!"
|
2024-04-12 18:50:55 +00:00
|
|
|
echo "You may view old chat with 'scry'!"
|
|
|
|
echo "----------------------------------"
|
2024-04-13 18:48:32 +00:00
|
|
|
printf "speak to the server: "
|
2024-04-12 18:50:55 +00:00
|
|
|
read -r text
|
|
|
|
makeSlug
|
|
|
|
echo "${prompt}: $text" >> $chatlog
|
|
|
|
clear
|
2024-02-09 20:13:25 +00:00
|
|
|
done
|