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 "╹ ╹┗╸┗━┛┗━╸┗━╸╹ ╹╹╹ ╹ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ "
|
|
|
|
echo "You may view old chat with 'scry'!"
|
|
|
|
echo "----------------------------------"
|
|
|
|
printf "speak to the server: " >&2
|
|
|
|
read -r text
|
|
|
|
makeSlug
|
|
|
|
echo "${prompt}: $text" >> $chatlog
|
|
|
|
clear
|
2024-02-09 20:13:25 +00:00
|
|
|
done
|